diff --git a/scipost_django/submissions/constants.py b/scipost_django/submissions/constants.py index d6d8f901489ed2b9fdc03295f5d8a03e54f6a789..ea7f895fae1ab2ddc8a9ab3853ba292829785d4e 100644 --- a/scipost_django/submissions/constants.py +++ b/scipost_django/submissions/constants.py @@ -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 diff --git a/scipost_django/submissions/models/recommendation.py b/scipost_django/submissions/models/recommendation.py index 62a6a9d4d2693540dcb7d395c819da75a622229d..e3bec94a0f2b2744ece6772a33db26b1f78e9226 100644 --- a/scipost_django/submissions/models/recommendation.py +++ b/scipost_django/submissions/models/recommendation.py @@ -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.""" diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html index 9557faa0209592822c073017c1993b979207dd05..171184ea15b14878a400a930713dda4a2aca0366 100644 --- a/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html @@ -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 }}  + {{ rec.get_full_status_short_display }}  {% if rec.undergoing_voting %} {% if rec|user_can_vote:request.user %} <a href="{% url 'submissions:vote_on_rec' rec_id=rec.id %}"> diff --git a/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html b/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html index 709054d2985e9543968b398d9a79c2d2ce352335..2e6020bb0fb2539ea0562c0e6a7f4d49c8345a31 100644 --- a/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html +++ b/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html @@ -53,7 +53,7 @@ <br> <small class="text-muted">EIC Recommendation & 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 %}