From e4de8f0cd609dbcf31d98ebe61fa9a6545a8fa74 Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Wed, 2 May 2018 18:05:14 +0200
Subject: [PATCH] Show older versions of edrecs

---
 submissions/models.py                                |  4 ++++
 .../templates/submissions/pool/recommendation.html   | 12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/submissions/models.py b/submissions/models.py
index 52c5a0b86..09c58957e 100644
--- a/submissions/models.py
+++ b/submissions/models.py
@@ -750,6 +750,10 @@ class EICRecommendation(SubmissionRelatedObjectMixin, models.Model):
         """Return the number of votes 'abstained'."""
         return self.voted_abstain.count()
 
+    def get_other_versions(self):
+        """Return other versions of EICRecommendations for this Submission."""
+        return self.submission.eicrecommendations.exclude(id=self.id)
+
     def may_be_reformulated(self):
         """Check if this EICRecommdation is allowed to be reformulated in a new version."""
         if not self.active:
diff --git a/submissions/templates/submissions/pool/recommendation.html b/submissions/templates/submissions/pool/recommendation.html
index 61aeab9f9..6a15dfd08 100644
--- a/submissions/templates/submissions/pool/recommendation.html
+++ b/submissions/templates/submissions/pool/recommendation.html
@@ -11,7 +11,7 @@
 {% block pagetitle %}: Editorial Recommendation{% endblock pagetitle %}
 
 {% block content %}
-    <h1>Editorial Recommendation to vote on</h1>
+    <h1 class="highlight">Editorial Recommendation to vote on</h1>
 
 
     {% include 'partials/submissions/submission_li.html' with submission=recommendation.submission %}
@@ -21,6 +21,16 @@
     {% include 'partials/submissions/pool/submission_info_table.html' with submission=recommendation.submission %}
     <br>
 
+    {% if recommendation.get_other_versions %}
+        <h3>Other versions of Editorial Recommendations for this Submission</h3>
+        {% for old_rec in recommendation.get_other_versions %}
+            {% include 'partials/submissions/recommendation_fellow_content.html' with recommendation=old_rec %}
+        {% endfor %}
+        <br>
+        <br>
+    {% endif %}
+
+    <h2 class="highlight">Editorial Recommendation to vote on</h2>
     {% include 'partials/submissions/recommendation_fellow_content.html' with recommendation=recommendation %}
 
     <div class="card">
-- 
GitLab