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:
Chris Hill-Scott
2016-09-09 15:57:05 +01:00
parent 6c961cc792
commit e9d230b9a4
2 changed files with 5 additions and 4 deletions

View File

@@ -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):

View File

@@ -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>