diff --git a/comments/templates/comments/new_comment.html b/comments/templates/comments/new_comment.html index 80f19afad8798a122d2dd5873019c139d02849ec..4aedb638ec55c389f72c29ca872dd1cbb1aa6609 100644 --- a/comments/templates/comments/new_comment.html +++ b/comments/templates/comments/new_comment.html @@ -1,11 +1,31 @@ +{% load bootstrap %} + {% if user.is_authenticated and open_for_commenting and perms.scipost.can_submit_comments %} -<hr /> -<div class="row"> +<script> + $(document).ready(function(){ + + var comment_text_input = $("#id_comment_text"); + + function set_comment_text(value) { + $("#preview-comment_text").text(value) + } + set_comment_text(comment_text_input.val()) + + comment_text_input.keyup(function(){ + var new_text = $(this).val() + set_comment_text(new_text) + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + }) + + }); +</script> + +<hr> + +<div class="row" id="contribute_comment"> <div class="col-12"> - <div class="panel"> - <h2>Contribute a Comment:</h2> - </div> + <h2 class="highlight">Contribute a Comment:</h2> </div> </div> <div class="row"> @@ -14,8 +34,45 @@ action="{% url 'comments:new_comment' object_id=object_id type_of_object=type_of_object %}" method="post"> {% csrf_token %} - {% load crispy_forms_tags %} - {% crispy form %} + <div class="row"> + <div class="col-md-9"> + {{form.comment_text|bootstrap:'12,12'}} + <p> + In your comment, you can use LaTeX \$...\$ for in-text equations or \ [ ... \ ] for on-line equations. + </p> + <p id="goodCommenter"><em> + Be professional. Only serious and meaningful comments will be vetted through. + </em></p> + </div> + <div class="col-md-3 radio-list"> + <label>Specify categorization(s):</label> + {{form.is_cor|bootstrap}} + {{form.is_rem|bootstrap}} + {{form.is_que|bootstrap}} + {{form.is_ans|bootstrap}} + {{form.is_obj|bootstrap}} + {{form.is_rep|bootstrap}} + {{form.is_val|bootstrap}} + {{form.is_lit|bootstrap}} + {{form.is_sug|bootstrap}} + </div> + </div> + + <div class="row"> + <div class="col-md-9"> + {{form.remarks_for_editors|bootstrap:'12,12'}} + </div> + <div class="col-md-3"> + {{form.file_attachment|bootstrap:'12,12'}} + </div> + </div> + + <div class="row"> + <div class="col-12"> + <input type="submit" name="submit" value="Submit your Comment for vetting" class="btn btn-primary" id="submit-id-submit"> + <p class="mt-2" id="goodCommenter"><i>By clicking on Submit, you agree with the <a target="_blank" href="{% url 'scipost:terms_and_conditions' %}">Terms and Conditions</a>.</i></p> + </div> + </div> </form> </div> <div class="col-12"> diff --git a/scipost/static/scipost/SciPost.css b/scipost/static/scipost/SciPost.css index 46c5fd27618f653474574f8ce093a8d15c2b0936..809411bdd49c4249e898fb4cf6dfefd45c184f44 100644 --- a/scipost/static/scipost/SciPost.css +++ b/scipost/static/scipost/SciPost.css @@ -797,6 +797,7 @@ li.publicationPDF { white-space: pre-wrap; word-wrap: break-word; padding: 1rem; + border-radius: 1.4px; } #preview-strengths { border: 1px solid black; diff --git a/scipost/static/scipost/assets/css/_form.scss b/scipost/static/scipost/assets/css/_form.scss index 49e94deed1017ee621bd8baea9d4dbdf6327db6c..46777f8099ba93a25eceef4208c93b3d7bb19824 100644 --- a/scipost/static/scipost/assets/css/_form.scss +++ b/scipost/static/scipost/assets/css/_form.scss @@ -26,3 +26,19 @@ textarea { width: 800px; max-width: 100%; } + +.radio-list label { + margin: 0; +} + +input[type="file"] { + width: 100%; + padding: 0.25rem 0.5rem; + font-size: 0.8rem; + line-height: 1.25; + background-color: #fff; + background-image: none; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.15rem; +} diff --git a/scipost/static/scipost/assets/css/_nav.scss b/scipost/static/scipost/assets/css/_nav.scss index f63e0e90038b6f249078894c1501098715fcc4eb..bb51a14f3958429d705af3d0506c43b46f21070c 100644 --- a/scipost/static/scipost/assets/css/_nav.scss +++ b/scipost/static/scipost/assets/css/_nav.scss @@ -2,17 +2,23 @@ padding: 0 !important; } +.nav > .btn { + border-radius: 1.4px; +} .nav.personal-page-nav { .nav-item { - background-color: #ddd; + background-color: #f0f0f0; color: #002b49; .nav-link.active { - background-color: #eeeeee; + background-color: #f8f8f8; + color: #6885c3; } a { color: #002b49; + padding-top: 0.4em; + padding-bottom: 0.4em; } } } diff --git a/scipost/static/scipost/assets/css/_tables.scss b/scipost/static/scipost/assets/css/_tables.scss index f5804cd57081915cd0ddd6da358bd5177562f70d..3b9121bdd4d948063edff877c61c36e66fca320a 100644 --- a/scipost/static/scipost/assets/css/_tables.scss +++ b/scipost/static/scipost/assets/css/_tables.scss @@ -10,3 +10,13 @@ .table-invitations { background-color: #ddd; } + +table.submission td { + padding: 0.1em 0.7em; + + &:first-child { + padding-left: 0; + padding-right: 1em; + min-width: 150px; + } +} diff --git a/scipost/templates/scipost/navbar.html b/scipost/templates/scipost/navbar.html index 29161549ed69fbbefbb3dd886868c413b44f1f65..127016d37730188ec1d884786cc120250ba5e9ea 100644 --- a/scipost/templates/scipost/navbar.html +++ b/scipost/templates/scipost/navbar.html @@ -40,7 +40,7 @@ </ul> <form action="{% url 'scipost:search' %}" method="get" class="form-inline"> <input class="form-control mr-0 mb-2 mr-lg-2 mb-lg-0" id="id_q" maxlength="100" name="q" type="text" required=""> - <button class="btn btn-primary" type="submit">Search</button> + <button class="btn btn-outline-secondary text-muted" type="submit">Search</button> </form> </div> </nav> diff --git a/scipost/templatetags/bootstrap.py b/scipost/templatetags/bootstrap.py index c06ec80d8eba9401d0696df6e668fa82bceda2f7..9c01b2d52c84f865802cbcb0acc2c6b5e9f1605b 100644 --- a/scipost/templatetags/bootstrap.py +++ b/scipost/templatetags/bootstrap.py @@ -20,17 +20,18 @@ def bootstrap(element, args='2,10'): -- 2. Column width for input -- 3. Additional argument 'sm' or 'lg' for form groups. ''' - args = [arg.strip() for arg in args.split(',')] + args = dict(enumerate(args.split(','))) markup_classes = { - 'label': 'col-md-%s' % args[0], - 'value': 'col-md-%s' % args[1], - 'single_value': '' + 'label': 'col-md-%s' % args.get(0, '4'), + 'value': 'col-md-%s' % args.get(1, '8'), + 'single_value': args.get(2, 'col-12'), + 'form_control': '' } - try: - markup_classes['label'] += ' col-form-label-%s' % args[2] - markup_classes['form_control'] = 'form-control-%s' % args[2] - except IndexError: - markup_classes['form_control'] = '' + + if args.get(2, False): + markup_classes['label'] += ' col-form-label-%s' % args.get(2) + markup_classes['form_control'] = 'form-control-%s' % args.get(2) + return render(element, markup_classes)