diff --git a/opentech/apply/funds/templates/funds/includes/review_sidebar_item.html b/opentech/apply/funds/templates/funds/includes/review_sidebar_item.html index 955624c17038d68fbca3a8ae66cd45b6eb8c6565..a8572ad45a35b9f8c464d8588fb160ead24b7d54 100644 --- a/opentech/apply/funds/templates/funds/includes/review_sidebar_item.html +++ b/opentech/apply/funds/templates/funds/includes/review_sidebar_item.html @@ -17,7 +17,7 @@ {% if reviewer.role %}{% image reviewer.role.icon max-12x12 %}{% endif %} </div> </a> - <div class="reviews-sidebar__date">{{ reviewer.review.updated_at|date:"Y-m-d" }}</div> + <div class="reviews-sidebar__date">{{ reviewer.review.created_at|date:"Y-m-d" }}</div> </div> {% else %} <div class="reviews-sidebar__name"> diff --git a/opentech/apply/review/models.py b/opentech/apply/review/models.py index 740f9d847f5e36709d68d12f60966a41e9457376..c9a9bf908b6b6f575a4be706a40a56bb1d82a10a 100644 --- a/opentech/apply/review/models.py +++ b/opentech/apply/review/models.py @@ -180,6 +180,11 @@ class Review(ReviewFormFieldsMixin, BaseStreamForm, AccessFormData, models.Model def reviewer_visibility(self): return self.visibility == REVIEWER + @cached_property + def is_updated(self): + # Only compear dates, not time. + return self.created_at.date() < self.updated_at.date() + class ReviewOpinion(models.Model): review = models.ForeignKey(Review, on_delete=models.CASCADE, related_name='opinions') diff --git a/opentech/apply/review/templates/review/review_detail.html b/opentech/apply/review/templates/review/review_detail.html index 20264332d8a1482f0609d56d7be9784e5d3af604..970005efc669792807d1dd285c1409407729d973 100644 --- a/opentech/apply/review/templates/review/review_detail.html +++ b/opentech/apply/review/templates/review/review_detail.html @@ -5,7 +5,7 @@ <div class="admin-bar"> <div class="admin-bar__inner"> <h1 class="beta heading heading--no-margin heading--bold">Review</h1> - <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.updated_at|date:"Y-m-d" }}</h5> + <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.created_at|date:"Y-m-d" }} {% if review.is_updated %}<small>(Last updated: {{ review.updated_at|date:"Y-m-d" }})</small>{% endif %}</h5> {% include 'review/includes/review_opinions_list.html' with opinions=review.opinions.all %} </div>