diff --git a/scipost_django/comments/templates/comments/new_comment.html b/scipost_django/comments/templates/comments/new_comment.html index 454bde0942f2e379470ed53bcebe1743c5055d55..c33bee158787504fa1a7b26b1186d5cd49c887a8 100644 --- a/scipost_django/comments/templates/comments/new_comment.html +++ b/scipost_django/comments/templates/comments/new_comment.html @@ -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 %} diff --git a/scipost_django/submissions/templates/submissions/_submission_quick_actions.html b/scipost_django/submissions/templates/submissions/_submission_quick_actions.html index 3134d2066739a8e6b3c2e451dc2e49875895eca0..c476882194aea7b5d6f9a92831b7c743ff2a98f4 100644 --- a/scipost_django/submissions/templates/submissions/_submission_quick_actions.html +++ b/scipost_django/submissions/templates/submissions/_submission_quick_actions.html @@ -1,3 +1,5 @@ +{% 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>