SciPost Code Repository

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

add short form display of EICRecommendations

fixes #91
parent c234982a
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,12 @@ EIC_REC_CHOICES = (
(EIC_REC_MAJOR_REVISION, "Ask for major revision"),
(EIC_REC_REJECT, "Reject"),
)
EIC_REC_CHOICES_SHORT = (
(EIC_REC_PUBLISH, "Publish"),
(EIC_REC_MINOR_REVISION, "Minor revision"),
(EIC_REC_MAJOR_REVISION, "Major revision"),
(EIC_REC_REJECT, "Reject"),
)
# Alternative recommendations
......@@ -185,6 +191,13 @@ EIC_REC_STATUSES = (
(DECISION_FIXED, "Editorial Recommendation fixed"),
(DEPRECATED, "Editorial Recommendation deprecated"),
)
EIC_REC_STATUSES_SHORT = (
(VOTING_IN_PREP, "In preparation"),
(PUT_TO_VOTING, "In voting"),
(VOTE_COMPLETED, "Voting completed"),
(DECISION_FIXED, "Rec. fixed"),
(DEPRECATED, "Rec. deprecated"),
)
# Editorial decision
......
......@@ -9,9 +9,11 @@ from django.utils import timezone
from ..behaviors import SubmissionRelatedObjectMixin
from ..constants import (
EIC_REC_CHOICES,
EIC_REC_CHOICES_SHORT,
EIC_REC_STATUSES,
DECISION_FIXED,
DEPRECATED,
EIC_REC_STATUSES_SHORT,
VOTING_IN_PREP,
PUT_TO_VOTING,
ALT_REC_CHOICES,
......@@ -151,6 +153,13 @@ class EICRecommendation(SubmissionRelatedObjectMixin, models.Model):
self.get_status_display(),
)
def get_full_status_short_display(self):
"""Return `recommendation` and `status` field display in short form."""
eicrec_short = dict(EIC_REC_CHOICES_SHORT).get(self.recommendation)
journal_name = self.for_journal.name_abbrev or ""
status_short = dict(EIC_REC_STATUSES_SHORT).get(self.status)
return f"{eicrec_short} - {journal_name} ({status_short})"
class AlternativeRecommendation(models.Model):
"""Alternative recommendation from voting Fellow who disagrees with EICRec."""
......
......@@ -154,7 +154,7 @@
<ul class="ps-3">
{% for rec in submission.eicrecommendations.all %}
<li>
<a href="{% url 'submissions:eic_recommendation_detail' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">{{ rec.get_full_status_display }}</a>
<a href="{% url 'submissions:eic_recommendation_detail' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}">{{ rec.get_full_status_short_display }}</a>
{% if is_ed_admin %}
{% if rec.voting_in_preparation %}
<a class="btn btn-sm btn-primary ms-4 px-1 py-0" role="button" href="{% url 'submissions:prepare_for_voting' rec_id=rec.id %}">Prepare for voting</a>
......@@ -185,7 +185,7 @@
<ul class="ps-3">
{% for rec in submission.eicrecommendations.all %}
<li>
{{ rec.get_full_status_display }}&emsp;
{{ rec.get_full_status_short_display }}&emsp;
{% if rec.undergoing_voting %}
{% if rec|user_can_vote:request.user %}
<a href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}">
......
......@@ -53,7 +53,7 @@
<br>
<small class="text-muted">EIC Recommendation &amp; Status</small>
<br>
{{ recommendation.get_full_status_display }}
{{ recommendation.get_full_status_short_display }}
<br>
<small class="text-muted">{{ recommendation.eligible_to_vote.count }} voting: {{ recommendation.voted_for.count }} agreed, {{ recommendation.voted_against.count }} disagreed, {{ recommendation.voted_abstain.count }} abstained</small>
{% 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