diff --git a/comments/forms.py b/comments/forms.py index 94b6fa62fefff353346ba27926df9aaa7f7e1ebb..ac922bb92967199688a976cdcac70dae74b08689 100644 --- a/comments/forms.py +++ b/comments/forms.py @@ -9,15 +9,20 @@ class CommentForm(forms.ModelForm): model = Comment fields = ['is_cor', 'is_rem', 'is_que', 'is_ans', 'is_obj', 'is_rep', 'is_val', 'is_lit', 'is_sug', - 'comment_text', 'remarks_for_editors', 'file_attachment'] + 'comment_text', 'remarks_for_editors', 'file_attachment', + 'anonymous'] def __init__(self, *args, **kwargs): - super(CommentForm, self).__init__(*args, **kwargs) + self.is_report_comment = kwargs.pop('is_report_comment', False) + super().__init__(*args, **kwargs) self.fields['comment_text'].widget.attrs.update( {'placeholder': 'NOTE: only serious and meaningful Comments will be accepted.'}) self.fields['remarks_for_editors'].widget.attrs.update( {'rows': 3, 'placeholder': '(these remarks will not be publicly visible)'}) + if not self.is_report_comment: + del self.fields['anonymous'] + class VetCommentForm(forms.Form): action_option = forms.ChoiceField(widget=forms.RadioSelect, choices=COMMENT_ACTION_CHOICES, diff --git a/comments/templates/comments/_add_comment_form.html b/comments/templates/comments/_add_comment_form.html index 3a02aca5239ab9357756b563bca58cbb468351bb..034d32a09f17a2ab79db85e75f482d43c481a86a 100644 --- a/comments/templates/comments/_add_comment_form.html +++ b/comments/templates/comments/_add_comment_form.html @@ -52,6 +52,7 @@ <div class="row"> <div class="col-12"> + {% if form.anonymous %}{{ form.anonymous|bootstrap }}{% endif %} <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>, in particular that <span class="text-danger">your identity will be attached to the Comment</span>.</i></p> </div> diff --git a/comments/templates/comments/_comment_categories.html b/comments/templates/comments/_comment_categories.html index 60b7720e7c5cdee801c81eb7f2157d55e027fec9..07e3c1d53072e4723c8baf86098421399d0dd48c 100644 --- a/comments/templates/comments/_comment_categories.html +++ b/comments/templates/comments/_comment_categories.html @@ -31,4 +31,5 @@ <div>suggestion for further work</div> {% endif %} </div> + <br> {% endif %} diff --git a/comments/templates/comments/_comment_identifier.html b/comments/templates/comments/_comment_identifier.html index fa6faab3c4287f02ef037b74f9a324d506cf983e..2d518ecedeea4fe7dd83cdf87755bd40e115d019 100644 --- a/comments/templates/comments/_comment_identifier.html +++ b/comments/templates/comments/_comment_identifier.html @@ -1,25 +1,33 @@ {% load comment_extras %} +{% load user_groups %} +{% load submissions_extras %} -<div class="commentid" id="comment_id{{comment.id}}"> - <h3> - {% if comment.is_author_reply %}Author{% endif %} +{% is_edcol_admin request.user as is_edcol_admin %} - <a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a> - on {{comment.date_submitted|date:'Y-m-d'}} +<div class="commentid" id="comment_id{{ comment.id }}"> + <h3> + {% if request.user.contributor and request.user.contributor == comment.core_content_object.editor_in_charge or is_edcol_admin and request.user|is_not_author_of_submission:comment.core_content_object.arxiv_identifier_w_vn_nr %} + <h3>{% if comment.anonymous %}(chose public anonymity) {% endif %}<a href="{{ comment.author.get_absolute_url }}">{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}</a> + on {{ comment.date_submitted|date:'Y-m-d' }} + </h3> + {% elif comment.anonymous %} + Anonymous on {{comment.date_submitted|date:'Y-m-d'}} + {% else %} + {% if comment.is_author_reply %}Author{% endif %} + <a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a> + on {{comment.date_submitted|date:'Y-m-d'}} + {% endif %} {% if comment.doi_string %} <small>doi: {{ comment.doi_string }}</small>{% endif %} </h3> {% if comment|is_reply_to_comment %} - (in reply to <a href="{{comment.content_object.get_absolute_url}}">{{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}</a> on {{comment.content_object.date_submitted|date:'Y-m-d'}}) + (in reply to <a href="{{comment.content_object.get_absolute_url}}">{% if comment.content_object.anonymous %}Anonymous Comment{% else %}{{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}{% endif %}</a> on {{comment.content_object.date_submitted|date:'Y-m-d'}}) {% elif comment|is_reply_to_report %} - (in reply to <a href="{{comment.content_object.get_absolute_url}}"> + (in reply to - Report {{comment.content_object.report_nr}} - {% if not comment.content_object.anonymous %} - by {{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}} - {% endif %} + <a href="{{comment.content_object.get_absolute_url}}">Report {{comment.content_object.report_nr}}{% if not comment.content_object.anonymous %} by {{comment.content_object.author.user.first_name}} {{comment.content_object.author.user.last_name}}{% endif %}</a> - </a> on {{comment.content_object.date_submitted|date:'Y-m-d'}}) + on {{comment.content_object.date_submitted|date:'Y-m-d'}}) {% endif %} </div> diff --git a/comments/templates/comments/_single_comment.html b/comments/templates/comments/_single_comment.html index ee94826ec7b15950249cc4f51465cee07fb6b5a4..665503b06852f4686845577dde1c1356898f831a 100644 --- a/comments/templates/comments/_single_comment.html +++ b/comments/templates/comments/_single_comment.html @@ -1,6 +1,10 @@ {% load scipost_extras %} {% load filename %} {% load file_extentions %} +{% load user_groups %} + +{% is_edcol_admin request.user as is_edcol_admin %} +{% is_editorial_college request.user as is_editorial_college %} <div class="comment"> {% include 'comments/_comment_identifier.html' with comment=comment %} @@ -25,7 +29,7 @@ </p> {% endif %} </p> - {% if user|is_in_group:'Editorial College' or user|is_in_group:'Editorial Administrators' %} + {% if is_editorial_college or is_edcol_admin %} {% if comment.remarks_for_editors %} <h3>Remarks for editors:</h3> <p>{{ comment.remarks_for_editors|linebreaks }}</p> diff --git a/comments/views.py b/comments/views.py index 9011315784e62cfeebc24c2d865e38b8a195b3c0..2de6693126a45ac20b03a1e8186879949c06609b 100644 --- a/comments/views.py +++ b/comments/views.py @@ -181,7 +181,7 @@ def reply_to_report(request, report_id): # Verify if this is from an author: is_author = report.submission.authors.filter(user=request.user).exists() - form = CommentForm(request.POST or None, request.FILES or None) + form = CommentForm(request.POST or None, request.FILES or None, is_report_comment=True) if form.is_valid(): newcomment = form.save(commit=False) newcomment.content_object = report diff --git a/journals/constants.py b/journals/constants.py index bc5554b2b0dc43a9e9b1fb966da2d0f37c6b7af8..da5c678eae99d18964113ca71b204208c397769e 100644 --- a/journals/constants.py +++ b/journals/constants.py @@ -14,7 +14,6 @@ SCIPOST_JOURNALS_SUBMIT = ( # Journal closed for submission SCIPOST_JOURNALS_NO_SUBMIT = ( (SCIPOST_JOURNAL_PHYSICS_SELECT, 'SciPost Physics Select'), - (SCIPOST_JOURNAL_PHYSICS_PROC, 'SciPost Physics Proceedings'), ) # All allowed journals diff --git a/scipost/static/scipost/assets/css/_buttons.scss b/scipost/static/scipost/assets/css/_buttons.scss index 4c1d9d4bbd2619b9bc50d7eed5980df0e7b3671a..6abdc7c02b81ac4c4a9c4d8ce9cc82c87f0ef977 100644 --- a/scipost/static/scipost/assets/css/_buttons.scss +++ b/scipost/static/scipost/assets/css/_buttons.scss @@ -39,13 +39,13 @@ .voting-group { border-radius: $card-border-radius; color: $scipost-darkblue; - box-shadow: 0 1px 0 0 $gray-600; + border: 1px solid $gray-600; > div { padding: 0.25rem 0.5rem; font-size: 0.8rem; border-radius: 0; - line-height: 1.25; + line-height: 1; margin: 0; display: inline-block; color: #002b49; @@ -98,3 +98,12 @@ } } } + +.category-group { + display: inline-block; + margin-bottom: 0.5rem; + + > div { + line-height: 1.3; + } +} diff --git a/submissions/templates/submissions/_single_public_report.html b/submissions/templates/submissions/_single_public_report.html index efdc5c5144fb7f7dde0959338e2d3c9b751582b4..c39fcdc22220cb2a003b96a637c94a49f6f19fca 100644 --- a/submissions/templates/submissions/_single_public_report.html +++ b/submissions/templates/submissions/_single_public_report.html @@ -6,6 +6,10 @@ <h3><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3> {% endif %} + {% if report.comments.vetted.exists %} + <br> + {% endif %} + {% for reply in report.comments.vetted %} {% include 'comments/_single_comment_with_link.html' with comment=reply perms=perms user=user %} {% endfor %} diff --git a/submissions/templatetags/submissions_extras.py b/submissions/templatetags/submissions_extras.py index 9cb66171d072b47b057a2a2b6e79817614db882c..d98be57a13f124f628b54f7e016404de300fd475 100644 --- a/submissions/templatetags/submissions_extras.py +++ b/submissions/templatetags/submissions_extras.py @@ -21,6 +21,7 @@ def is_viewable_by_authors(recommendation): 'accepted', 'rejected', 'published', 'withdrawn'] + @register.filter def user_is_referee(submission, user): return submission.referee_invitations.filter(referee__user=user).exists()