From 4a57f4fc356be19ff3717ebeca5f62e74fed6a46 Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Mon, 8 Oct 2018 09:41:40 +0200
Subject: [PATCH] Update text in pool

---
 submissions/models.py                                     | 8 ++++++++
 .../partials/submissions/pool/assignment_info.html        | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/submissions/models.py b/submissions/models.py
index 53488671a..a365f8865 100644
--- a/submissions/models.py
+++ b/submissions/models.py
@@ -409,6 +409,14 @@ class EditorialAssignment(SubmissionRelatedObjectMixin, models.Model):
         """Return string representation of this EditorialAssigment as shown in Notifications."""
         return self.submission.preprint.identifier_w_vn_nr
 
+    @property
+    def preassigned(self):
+        return self.status == STATUS_PREASSIGNED
+
+    @property
+    def invited(self):
+        return self.status == STATUS_INVITED
+
     @property
     def replaced(self):
         return self.status == STATUS_REPLACED
diff --git a/submissions/templates/partials/submissions/pool/assignment_info.html b/submissions/templates/partials/submissions/pool/assignment_info.html
index 73a8ec610..ced9d7a14 100644
--- a/submissions/templates/partials/submissions/pool/assignment_info.html
+++ b/submissions/templates/partials/submissions/pool/assignment_info.html
@@ -1,6 +1,9 @@
 <li class="py-1">
     {{ assignment.to.user.first_name }} {{ assignment.to.user.last_name }}
 
+    {% if assignment.invited %}
+        <span class="label label-sm label-info">invited</span>
+    {% endif %}
     {% if assignment.accepted %}
         <span class="label label-sm label-outline-success">accepted</span>
     {% endif %}
@@ -18,7 +21,7 @@
 
     <br>
     <span class="text-muted">
-        requested {{ assignment.date_created }}
+        invited {{ assignment.date_invited|default:'<i>TBA</i>'|safe }}
         {% if assignment.date_answered %}
             | answered {{ assignment.date_answered }}
         {% endif %}
-- 
GitLab