diff --git a/submissions/models.py b/submissions/models.py index 401e6caef049192a906ea7e12a4d7cf2d41c4fa7..e5fb47eb4424289c7bd3dd6f6d1f1d629694db8a 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -176,6 +176,12 @@ class Submission(models.Model): @cached_property def other_versions(self): + return Submission.objects.public().filter( + arxiv_identifier_wo_vn_nr=self.arxiv_identifier_wo_vn_nr + ).exclude(pk=self.id).order_by('-arxiv_vn_nr') + + @cached_property + def other_versions_pool(self): return Submission.objects.filter( arxiv_identifier_wo_vn_nr=self.arxiv_identifier_wo_vn_nr ).exclude(pk=self.id).order_by('-arxiv_vn_nr') diff --git a/submissions/templates/submissions/editorial_page.html b/submissions/templates/submissions/editorial_page.html index 1119bd13ff47ac7c57b18b65061083199f156c80..6d29d4075433e05a154953719b270919be79b224 100644 --- a/submissions/templates/submissions/editorial_page.html +++ b/submissions/templates/submissions/editorial_page.html @@ -20,7 +20,7 @@ <div class="ml-2 mt-2"> <h3>- Go to the <a href="{% url 'submissions:submission' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Submissions Page</a> to view Reports and Comments</h3> - {% if submission.other_versions or not submission.is_current %} + {% if submission.other_versions_pool or not submission.is_current %} <ul class="mt-3 mb-1 list-unstyled pl-4"> {% if not submission.is_current %} <li> @@ -28,10 +28,10 @@ </li> {% endif %} - {% if submission.other_versions %} + {% if submission.other_versions_pool %} <li>Other versions of this Submission exist:</li> <ul class="list-unstyled"> - {% for vn in submission.other_versions %} + {% for vn in submission.other_versions_pool %} <li>{% include 'submissions/_submission_version.html' with submission=vn editorial_page=1 %}</li> {% endfor %} </ul>