SciPost Code Repository

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

add persistent referee numbering to reports

fixes #26
parent b234b7e5
No related branches found
No related tags found
No related merge requests found
...@@ -320,6 +320,18 @@ class Report(SubmissionRelatedObjectMixin, models.Model): ...@@ -320,6 +320,18 @@ class Report(SubmissionRelatedObjectMixin, models.Model):
citation += "doi: %s" % self.doi_string citation += "doi: %s" % self.doi_string
return citation return citation
@cached_property
def referee_nr_in_thread(self):
"""Return the number of the referee in the thread."""
ordered_reports = list(
Report.objects.filter(
submission__thread_hash=self.submission.thread_hash,
)
.order_by("date_submitted")
.values_list("author__id", flat=True)
)
return ordered_reports.index(self.author.id) + 1
def create_doi_label(self): def create_doi_label(self):
"""Create a doi in the default format.""" """Create a doi in the default format."""
Report.objects.filter(id=self.id).update( Report.objects.filter(id=self.id).update(
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<div class="col-12"> <div class="col-12">
<div class="reportid"> <div class="reportid">
<h3> <h3>
Report #{{ report.report_nr }} by
{% if report.anonymous %} {% if report.anonymous %}
Anonymous Report {{ report.report_nr }} Anonymous
{% else %} {% else %}
Report {{ report.report_nr }} by <a href="{{ report.author.get_absolute_url }}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a> <a href="{{ report.author.get_absolute_url }}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a>
{% endif %} {% endif %}
(Referee {{ report.referee_nr_in_thread }}) on {{ report.date_submitted|date:'Y-n-j' }}
on {{ report.date_submitted|date:'Y-n-j' }}
{% if report.report_type == 'report_post_edrec' %} {% if report.report_type == 'report_post_edrec' %}
<small><label class="label label-outline-primary ms-2">Post-Editorial Recommendation Report</label> <span class="text-primary" data-bs-toggle="tooltip" data-bs-placement="auto" data-bs-html="true" title="Post-Editorial Reports are submitted after the Editorial Recommendation has been formulated." aria-hidden="true">{% include 'bi/question-circle-fill.html' %}</span></small> <small><label class="label label-outline-primary ms-2">Post-Editorial Recommendation Report</label> <span class="text-primary" data-bs-toggle="tooltip" data-bs-placement="auto" data-bs-html="true" title="Post-Editorial Reports are submitted after the Editorial Recommendation has been formulated." aria-hidden="true">{% include 'bi/question-circle-fill.html' %}</span></small>
{% endif %} {% endif %}
......
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