From 852bde7fe14b6f4dbd83815a0a3bb432457fc2a3 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Wed, 19 Sep 2018 15:40:20 +0200
Subject: [PATCH] Add Journal/Tier info for accepted submission in production
 page

---
 production/templates/production/production.html |  3 +++
 submissions/templatetags/submissions_extras.py  | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/production/templates/production/production.html b/production/templates/production/production.html
index ed1c3eed0..4c5d7dd33 100644
--- a/production/templates/production/production.html
+++ b/production/templates/production/production.html
@@ -8,6 +8,7 @@
 
 {% load bootstrap %}
 {% load scipost_extras %}
+{% load submissions_extras %}
 
 {% block content %}
 
@@ -55,6 +56,7 @@
                         <thead>
                             <tr>
                                 <th style="width: 30%;">Submission</th>
+				<th>Target Journal<br/>(Tier)</th>
                                 <th>Status</th>
                                 <th class="py-1">
                                     Latest activity
@@ -77,6 +79,7 @@
                                         <br>
                                         by {{ stream.submission.author_list }}
                                     </td>
+				    <td>{{ stream.submission.get_submitted_to_journal_display }}{% for rec in stream.submission.eicrecommendations.all %}<br/>({{ rec|Tier }}){% endfor %}</td>
                                     <td>
                                         <div class="label label-{% if stream.status == 'initiated' %}outline-danger{% else %}secondary{% endif %} label-sm">{{ stream.get_status_display }}</div>
                                     </td>
diff --git a/submissions/templatetags/submissions_extras.py b/submissions/templatetags/submissions_extras.py
index 15cd2988f..b8a8e4f51 100644
--- a/submissions/templatetags/submissions_extras.py
+++ b/submissions/templatetags/submissions_extras.py
@@ -4,7 +4,7 @@ __license__ = "AGPL v3"
 
 from django import template
 
-from ..constants import DECISION_FIXED
+from ..constants import DECISION_FIXED, REPORT_PUBLISH_1, REPORT_PUBLISH_2, REPORT_PUBLISH_3
 from ..models import Submission, EICRecommendation
 
 register = template.Library()
@@ -58,3 +58,15 @@ def is_voting_fellow(submission, user):
 @register.filter
 def citation(citable):
     return citable.citation
+
+
+@register.filter
+def Tier(recommendation):
+    if recommendation.recommendation == REPORT_PUBLISH_1:
+        return 'Tier I'
+    elif recommendation.recommendation == REPORT_PUBLISH_2:
+        return 'Tier II'
+    elif recommendation.recommendation == REPORT_PUBLISH_3:
+        return 'Tier III'
+    else:
+        return 'unknown Tier'
-- 
GitLab