mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-19 05:53:51 -04:00
Always show created time for sending state
When a notification is in `created` or `sending` the thing you care about is how long it’s been sitting there.
This commit is contained in:
@@ -282,11 +282,11 @@ def format_notification_status(status, template_type):
|
||||
}.get(template_type).get(status, status)
|
||||
|
||||
|
||||
def format_notification_status_as_time(status, when):
|
||||
def format_notification_status_as_time(status, created, updated):
|
||||
return {
|
||||
'sending': ' since {}'.format(when),
|
||||
'created': ' since {}'.format(when)
|
||||
}.get(status, when)
|
||||
'sending': ' since {}'.format(created),
|
||||
'created': ' since {}'.format(created)
|
||||
}.get(status, updated)
|
||||
|
||||
|
||||
def format_notification_status_as_field_status(status):
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
{% endif %}
|
||||
<span class="status-hint">
|
||||
{{ notification.status|format_notification_status_as_time(
|
||||
notification.created_at|format_datetime_short,
|
||||
(notification.updated_at or notification.created_at)|format_datetime_short
|
||||
) }}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user