diff --git a/hypha/apply/activity/templates/activity/include/listing_base.html b/hypha/apply/activity/templates/activity/include/listing_base.html index 8727ac0c74cd768ab6fa090a68143c3ead106ee1..197b825148d90d783a74caffaf8babeebc48e4a3 100644 --- a/hypha/apply/activity/templates/activity/include/listing_base.html +++ b/hypha/apply/activity/templates/activity/include/listing_base.html @@ -6,7 +6,7 @@ <div class="feed__content js-feed-content"> <div class="feed__meta js-feed-meta"> <p class="feed__label feed__label--{{ activity.type }} feed__label--mobile">{{ activity.type|capfirst }}</p> - <p class="feed__meta-item"><span>{{ activity|display_author:request.user }}</span> – {{ activity.timestamp|date:"Y-m-d H:i" }}</p> + <p class="feed__meta-item"><span>{{ activity|display_author:request.user }}</span> – {{ activity.timestamp|date:"SHORT_DATETIME_FORMAT" }}</p> {% if editable %} {% if activity.user == request.user %} @@ -18,7 +18,7 @@ </p> {% endif %} <p class="feed__meta-item feed__meta-item--last-edited" {% if not activity.edited %} hidden {% endif %}> - (Last edited: <span class="js-last-edited">{{ activity.edited|date:"Y-m-d H:i" }}</span>) + (Last edited: <span class="js-last-edited">{{ activity.edited|date:"SHORT_DATETIME_FORMAT" }}</span>) </p> {% endif %} diff --git a/hypha/apply/determinations/models.py b/hypha/apply/determinations/models.py index faa8a69bab579cafbed6dd84f8e7b1fe03b2092d..237d0d73b0b54557546725396004bd3ea818d1af 100644 --- a/hypha/apply/determinations/models.py +++ b/hypha/apply/determinations/models.py @@ -28,12 +28,16 @@ from .options import ACCEPTED, DETERMINATION_CHOICES, REJECTED class DeterminationQuerySet(models.QuerySet): + def staff(self): + # Designed to be used with a queryset related to submissions + return self.all().order_by('-updated_at') + def active(self): # Designed to be used with a queryset related to submissions - return self.get(is_draft=True) + return self.get(is_draft=True).order_by('-updated_at') def submitted(self): - return self.filter(is_draft=False) + return self.filter(is_draft=False).order_by('-updated_at') def final(self): return self.submitted().filter(outcome__in=[ACCEPTED, REJECTED]) diff --git a/hypha/apply/determinations/templates/determinations/includes/applicant_determination_block.html b/hypha/apply/determinations/templates/determinations/includes/applicant_determination_block.html index ef275a4492b974b77f895ac3edf218bc0e4309d5..24dbfe9eb79d26bc10616c91801f85bee0cba2f1 100644 --- a/hypha/apply/determinations/templates/determinations/includes/applicant_determination_block.html +++ b/hypha/apply/determinations/templates/determinations/includes/applicant_determination_block.html @@ -1,11 +1,12 @@ +{% load humanize %} <div class="sidebar__inner"> - <h5>Determination</h5> + <h5>Determinations</h5> {% for determination in object.determinations.submitted %} <p> <a class="link link--bold" href="{% url 'apply:submissions:determinations:detail' submission_pk=object.id pk=determination.id %}"> {{ determination.get_outcome_display }} </a> - - {{ determination.updated_at|date:"Y-m-d" }} by {{ determination.author }} + - <time datetime="{{ determination.updated_at|date:"c" }}" title="{{ determination.updated_at|date:"SHORT_DATETIME_FORMAT" }}">{{ determination.updated_at|naturaltime }}</time> by {{ determination.author }} </p> {% empty %} <p>Awaiting determination</p> diff --git a/hypha/apply/determinations/templates/determinations/includes/determination_block.html b/hypha/apply/determinations/templates/determinations/includes/determination_block.html index 92eb6baf1aeb3d9ba3bbc0d75032dfcb29297a0c..4987a0a5352674b2acc6cba88c6fd5f010628e4d 100644 --- a/hypha/apply/determinations/templates/determinations/includes/determination_block.html +++ b/hypha/apply/determinations/templates/determinations/includes/determination_block.html @@ -1,12 +1,12 @@ -{% load determination_tags %} +{% load humanize determination_tags %} <div class="sidebar__inner"> - <h5>Determination</h5> - {% for determination in object.determinations.all %} + <h5>Determinations</h5> + {% for determination in object.determinations.staff %} <p> <a class="link link--bold" href="{% url 'apply:submissions:determinations:detail' submission_pk=object.id pk=determination.id %}"> {% if determination.is_draft %}[Draft] {% endif %}{{ determination.get_outcome_display }} </a> - - {{ determination.updated_at|date:"Y-m-d" }} by {{ determination.author }} + - <time datetime="{{ determination.updated_at|date:"c" }}" title="{{ determination.updated_at|date:"SHORT_DATETIME_FORMAT" }}">{{ determination.updated_at|naturaltime }}</time> by {{ determination.author }} </p> {% empty %} <p>Awaiting determination</p> diff --git a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html b/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html index 4040de06b17f883ee8e96c52506f8ed7421e6efb..1c9cb1107735b1325758947c12b0fcd70f19df99 100644 --- a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html +++ b/hypha/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.created_at|date:"Y-m-d" }}</div> + <div class="reviews-sidebar__date">{{ reviewer.review.created_at|date:"SHORT_DATE_FORMAT" }}</div> </div> {% else %} <div class="reviews-sidebar__name"> diff --git a/hypha/apply/funds/templates/funds/includes/round-block-listing.html b/hypha/apply/funds/templates/funds/includes/round-block-listing.html index 6136b584db97e8bc638e1d1442f25ac9d835ae11..e6da436972054fca89d91b3e4f7898ee83352939 100644 --- a/hypha/apply/funds/templates/funds/includes/round-block-listing.html +++ b/hypha/apply/funds/templates/funds/includes/round-block-listing.html @@ -8,7 +8,7 @@ <p> {{ round.fund|default_if_none:"-" }} </p> <p class="round-block__date"> {% if round.end_date %} - {{ display_text }} {{ round.end_date|date:"Y-m-d" }} + {{ display_text }} {{ round.end_date|date:"SHORT_DATE_FORMAT" }} {% else %} Open {% endif %} diff --git a/hypha/apply/funds/templates/funds/tables/table.html b/hypha/apply/funds/templates/funds/tables/table.html index c9d6eed8b20c68a775f8ec30f5f539e159e47219..0c71cd59457c1d46c83d51f07ccfb5821aa20de6 100644 --- a/hypha/apply/funds/templates/funds/tables/table.html +++ b/hypha/apply/funds/templates/funds/tables/table.html @@ -28,7 +28,7 @@ <td> {% if submission.last_update %} <strong>by {{ submission.last_user_update }}</strong><br/> - {{ submission.last_update|date:"Y-m-d \a\t H:i" }} + {{ submission.last_update|date:"SHORT_DATETIME_FORMAT" }} {% else %} — {% endif %} diff --git a/hypha/apply/projects/templates/application_projects/project_admin_detail.html b/hypha/apply/projects/templates/application_projects/project_admin_detail.html index f7ef7817bc0e9204d9ca7fcca66d2a327c42ea48..356bb906dd6cf059508f5b59cb2831ad0acc77a6 100644 --- a/hypha/apply/projects/templates/application_projects/project_admin_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_admin_detail.html @@ -112,7 +112,7 @@ <h5>Approved By:</h5> {% for approval in approvals %} - <p>{{ approval.by }} - {{ approval.created_at|date:"Y-m-d" }}</p> + <p>{{ approval.by }} - {{ approval.created_at|date:"SHORT_DATE_FORMAT" }}</p> {% endfor %} </div> {% endblock %} diff --git a/hypha/apply/review/templates/review/review_detail.html b/hypha/apply/review/templates/review/review_detail.html index 970005efc669792807d1dd285c1409407729d973..a2e7108069c9d72b4e2a739e2e6237deff15a4e1 100644 --- a/hypha/apply/review/templates/review/review_detail.html +++ b/hypha/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.created_at|date:"Y-m-d" }} {% if review.is_updated %}<small>(Last updated: {{ review.updated_at|date:"Y-m-d" }})</small>{% endif %}</h5> + <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.created_at|date:"SHORT_DATE_FORMAT" }} {% if review.is_updated %}<small>(Last updated: {{ review.updated_at|date:"SHORT_DATE_FORMAT" }})</small>{% endif %}</h5> {% include 'review/includes/review_opinions_list.html' with opinions=review.opinions.all %} </div> diff --git a/hypha/public/news/templates/news/news_index.html b/hypha/public/news/templates/news/news_index.html index 84c5c7ef6e8a080e4e1b1db831c6ccb9f97a1b2e..1e23535d93cd21d64fed58e16b750d9eb4787c9c 100644 --- a/hypha/public/news/templates/news/news_index.html +++ b/hypha/public/news/templates/news/news_index.html @@ -36,7 +36,7 @@ <h6 class="listing__teaser">{{ n.listing_summary|default:n.introduction }}</h6> {% endif %} <span class="listing__meta"> - {{ n.display_date|date:"Y-m-d" }} + {{ n.display_date|date:"SHORT_DATE_FORMAT" }} {% if n.authors.all %} | By: {% for author in n.authors.all %}