SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4c969943 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

guard invited referees from submitting a comment

fixes #85
parent 60ea9fb1
No related branches found
No related tags found
No related merge requests found
......@@ -2,21 +2,37 @@
{% if user.is_authenticated and open_for_commenting and perms.scipost.can_submit_comments %}
<hr class="divider">
<h2 class="highlight" id="contribute_comment">Contribute a Comment</h2>
{% if user_is_referee and submission %}
<h4 class="text-danger my-3">
{% include 'bi/exclamation-triangle-fill.html' %}
You are an invited referee, please <a href="{% url 'submissions:submit_report' submission.preprint.identifier_w_vn_nr %}">submit a Report</a> instead.
</h4>
<details id="contribute_comment">
<summary class="highlight fs-5 p-2">I'm know, but let me contribute a Comment anyway</summary>
{% 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 %}
</details>
{% else %}
<details open id="contribute_comment">
<summary class="highlight fs-5 p-2">Contribute a Comment</summary>
{% 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 %}
</details>
{% endif %}
{% 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 %}
{% elif not user.is_authenticated %}
<h3 class="text-center my-3"><a href="{% url 'scipost:login' %}?next={{ request.path }}">Login to comment</a></h3>
<h3 class="text-center my-3">
<a href="{% url 'scipost:login' %}?next={{ request.path }}">Login to comment</a>
</h3>
{% endif %}
{% load submissions_extras %}
{% if perms.scipost.can_submit_comments %}
<div class="submission-quick-actions">
<h3>Actions</h3>
......@@ -52,10 +54,10 @@
{% endif %}
{% if submission.open_for_commenting %}
{% if perms.scipost.can_submit_comments %}
<li class="pt-1">
<h4><a href="#contribute_comment">Contribute a Comment</a></h4>
</li>
{% if perms.scipost.can_submit_comments and submission and not submission|user_is_referee:request.user %}
<li class="pt-1">
<h4><a href="#contribute_comment">Contribute a Comment</a></h4>
</li>
{% endif %}
{% else %}
<li class="py-1">Commenting on this Submission is closed.</li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment