diff --git a/comments/templates/comments/_add_comment_form.html b/comments/templates/comments/_add_comment_form.html index ac4a6b8c1e9d482d8a08e01f1ad3fed8c59f708e..3a02aca5239ab9357756b563bca58cbb468351bb 100644 --- a/comments/templates/comments/_add_comment_form.html +++ b/comments/templates/comments/_add_comment_form.html @@ -53,7 +53,7 @@ <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> + <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> </div> </form> diff --git a/comments/templates/comments/new_comment.html b/comments/templates/comments/new_comment.html index 59865219786dc0e0b42e2a3fdd89f16136815881..f0470b100f6328b3c92f161ca597155fc7ad46f2 100644 --- a/comments/templates/comments/new_comment.html +++ b/comments/templates/comments/new_comment.html @@ -4,7 +4,7 @@ <hr> -<h2 class="highlight" id="contribute_comment">Contribute a Comment:</h2> +<h2 class="highlight" id="contribute_comment">Contribute a Comment: {% if user_is_referee and submission %} <small class="text-danger">you are an invited referee, please <a href="{% url 'submissions:submit_report' submission.arxiv_identifier_w_vn_nr %}">submit a Report</a> instead</small>{% endif %}</h2> {% url 'comments:new_comment' object_id=object_id type_of_object=type_of_object as url %} {% include 'comments/_add_comment_form.html' with form=form url=url %} diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 891f73799991e18c7faf3bf55ae2ceee6a6f5d53..552fefc9a7b21581f76b724e5b719c905d6be6be 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -239,9 +239,9 @@ {# This is an apparent redundant logic block; however, it makes sure the "login to ..." links wouldn't be shown twice! #} {% if not user.is_authenticated and submission.comments.vetted.exists %} - {% include 'comments/new_comment.html' with object_id=submission.id type_of_object='submission' open_for_commenting=submission.open_for_commenting %} + {% include 'comments/new_comment.html' with object_id=submission.id type_of_object='submission' open_for_commenting=submission.open_for_commenting user_is_referee=submission|user_is_referee:request.user %} {% elif user.is_authenticated %} - {% include 'comments/new_comment.html' with object_id=submission.id type_of_object='submission' open_for_commenting=submission.open_for_commenting %} + {% include 'comments/new_comment.html' with object_id=submission.id type_of_object='submission' open_for_commenting=submission.open_for_commenting user_is_referee=submission|user_is_referee:request.user %} {% endif %} {% endblock content %} diff --git a/submissions/templatetags/submissions_extras.py b/submissions/templatetags/submissions_extras.py index de71caafbddb5aae5dc1edbe542a717123796841..0ec7944d18a2fb3e51a2f06d6f47b791f86c6034 100644 --- a/submissions/templatetags/submissions_extras.py +++ b/submissions/templatetags/submissions_extras.py @@ -23,3 +23,7 @@ def is_viewable_by_authors(recommendation): return recommendation.submission.status in ['revision_requested', 'resubmitted', 'accepted', 'rejected', 'published', 'withdrawn'] + +@register.filter +def user_is_referee(submission, user): + return submission.referee_invitations.filter(referee__user=user).exists()