Skip to content
Snippets Groups Projects
Commit b9550f0b authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Display created date instead of updated date for reviews. On detail page show...

Display created date instead of updated date for reviews. On detail page show updated as well if different from created.
parent 3baf5081
No related branches found
No related tags found
No related merge requests found
......@@ -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">
......
......@@ -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')
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment