From b016a99faf264755c0c88fdd70edc72d640ff34e Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Wed, 13 Jun 2018 11:52:22 +0100 Subject: [PATCH] Include the last edit method, to be improved with revisioning --- opentech/apply/funds/models.py | 6 ++++++ .../funds/templates/funds/applicationsubmission_detail.html | 1 + 2 files changed, 7 insertions(+) diff --git a/opentech/apply/funds/models.py b/opentech/apply/funds/models.py index e5f72cdfb..8f3558e6a 100644 --- a/opentech/apply/funds/models.py +++ b/opentech/apply/funds/models.py @@ -575,6 +575,12 @@ class ApplicationSubmission(WorkflowHelpers, BaseStreamForm, AbstractFormSubmiss def active(self): return self.status in active_statuses + @property + def last_edit(self): + # Best estimate of last edit + # TODO update when we have revisioning included + return self.activities.first() + def ensure_user_has_account(self): if self.user and self.user.is_authenticated: self.form_data['email'] = self.user.email diff --git a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html index dd6b4c231..8c159b45d 100644 --- a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html @@ -48,6 +48,7 @@ <div> <h6 class="heading heading--submission-meta"> <span>Submitted: </span>{{ object.submit_time.date }} by {{ object.user.get_full_name }} + <span>Edited: </span>{{ object.last_edit.timestamp.date }} by {{ object.last_edit.user.get_full_name }} {% if request.user|has_edit_perm:object %} <a href="{% url 'funds:submissions:edit' object.id %}">Edit</a> {% endif %} -- GitLab