SciPost Code Repository

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

feat: :lipstick: add links to ref. history section

Adds editorial page, submission page links and quick-reply for unreplied author reports.

fixes #367
parent c43d7599
No related branches found
No related tags found
No related merge requests found
{% if comments %} {% load submissions_extras %}
<ul class="{{ css_class|default:'' }}">
{% for comment in comments %} {% with is_author=request.user|is_submission_author:sibling %}
<li><a href="{{ comment.get_absolute_url }}"{% if target_blank %} target="_blank"{% endif %}>{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} by {{ comment.get_author_str }} on {{ comment.date_submitted|date:'DATE_FORMAT' }}</a></li>
{% include 'comments/_comments_list.html' with comments=comment.nested_comments.vetted css_class='m-0 ps-4' %} {% if comments or is_author and report %}
{% endfor %} <ul class="{{ css_class|default:'' }}">
</ul> {% for comment in comments %}
{% endif %} <li>
<a href="{{ comment.get_absolute_url }}"{% if target_blank %} target="_blank"{% endif %}>
{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %}
by {{ comment.get_author_str }} on {{ comment.date_submitted|date:'DATE_FORMAT' }}
</a>
</li>
{% include 'comments/_comments_list.html' with comments=comment.nested_comments.vetted css_class='m-0 ps-4' %}
{% endfor %}
<!-- Show reply action for authors next to unanswered reports -->
{% if is_author and report and not report.comments.author_replies.exists %}
<li>
<a href="{% url 'comments:reply_to_report' report_id=report.id %}">
<span class="me-2">{% include "bi/pencil-square.html" %}</span>Reply to this referee report
</a>
</li>
{% endif %}
</ul>
{% endif %}
{% endwith %}
\ No newline at end of file
{% if sibling.preprint.identifier_w_vn_nr in request.path %} {% if sibling.preprint.identifier_w_vn_nr in request.path %}
<p class="text-center bg-info"><em>You are viewing this version</em></p> <p class="text-center bg-info"><em>You are viewing this version</em></p>
{% endif %} {% endif %}
<div class="mt-3 mb-1"> <div class="d-flex flex-column mt-3 mb-1">
{% if sibling.is_resubmission_of %}Resubmission{% else %}Submission{% endif %} <a href="{{ sibling.get_absolute_url }}" class="pubtitleli"{% if target_blank %} target="_blank"{% endif %}>{{ sibling.preprint.identifier_w_vn_nr }}</a> on {{ sibling.submission_date|date:'j F Y' }} <div class="d-flex justify-content-between align-items-center pubtitleli fs-5 pe-1 ps-3">
<a href="{{ sibling.get_absolute_url }}" {% if target_blank %} target="_blank"{% endif %}>{{ sibling.preprint.identifier_w_vn_nr }}</a>
{% if submission.editor_in_charge == request.user.contributor or perms.scipost.can_oversee_refereeing and not is_author and not is_author_unchecked %}
<div class="d-flex gap-1">
<a href="{% url 'submissions:submission' sibling.preprint.identifier_w_vn_nr %}" class="px-2 py-1 bg-primary text-white"
data-bs-toggle="tooltip" title="Submission Page"> {% include "bi/journal-text.html" %}</a>
<a href="{% url 'submissions:editorial_page' sibling.preprint.identifier_w_vn_nr %}" class="px-2 py-1 bg-warning text-white"
data-bs-toggle="tooltip" title="Editorial Page"> {% include "bi/pen-nib-fill.html" %}</a>
</div>
{% endif %}
</div>
<span class="text-muted mx-3">{% if sibling.is_resubmission_of %}Resubmission{% else %}Original submission{% endif %} on {{ sibling.submission_date|date:'Y-m-d' }}</span>
</div> </div>
<ul class="my-2 ps-4"> <ul class="my-2 ps-4">
{% for report in sibling.reports.accepted %} {% for report in sibling.reports.accepted %}
......
...@@ -44,6 +44,10 @@ def is_possible_author_of_submission(user, submission): ...@@ -44,6 +44,10 @@ def is_possible_author_of_submission(user, submission):
# User explicitly assigned author. # User explicitly assigned author.
return True return True
if submission.author_profiles.filter(profile=user.contributor.profile).exists():
# Profile associated with the Submission during preassignment.
return True
if submission.authors_false_claims.filter(user=user).exists(): if submission.authors_false_claims.filter(user=user).exists():
# User explicitly dissociated from the Submission. # User explicitly dissociated from the Submission.
return False return False
...@@ -52,6 +56,18 @@ def is_possible_author_of_submission(user, submission): ...@@ -52,6 +56,18 @@ def is_possible_author_of_submission(user, submission):
return user.last_name in submission.author_list return user.last_name in submission.author_list
@register.filter
def is_submission_author(user, submission):
if not user.is_authenticated:
return False
verified_author = submission.authors.filter(user=user).exists()
preassigned_author = submission.author_profiles.filter(
profile=user.contributor.profile
).exists()
return verified_author or preassigned_author
@register.filter @register.filter
def is_viewable_by_authors(recommendation): def is_viewable_by_authors(recommendation):
"""Check if the EICRecommendation is viewable by the authors of the Submission.""" """Check if the EICRecommendation is viewable by the authors of the Submission."""
......
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