mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-17 13:09:49 -04:00
Show delivery time even for failed notifications
We reckon it’s probably still useful.
This commit is contained in:
@@ -116,7 +116,7 @@ def create_app():
|
||||
application.add_template_filter(format_date_normal)
|
||||
application.add_template_filter(format_date_short)
|
||||
application.add_template_filter(format_notification_status)
|
||||
application.add_template_filter(format_notification_status_with_time)
|
||||
application.add_template_filter(format_notification_status_as_time)
|
||||
application.add_template_filter(format_notification_status_as_field_status)
|
||||
application.add_template_filter(format_notification_status_as_url)
|
||||
|
||||
@@ -282,12 +282,11 @@ def format_notification_status(status, template_type):
|
||||
}.get(template_type).get(status, status)
|
||||
|
||||
|
||||
def format_notification_status_with_time(status, template_type, when):
|
||||
def format_notification_status_as_time(status, when):
|
||||
return {
|
||||
'delivered': 'Delivered {}'.format(when),
|
||||
'sending': 'Sending since {}'.format(when),
|
||||
'created': 'Sending since {}'.format(when)
|
||||
}.get(status, format_notification_status(status, template_type))
|
||||
'sending': ' since {}'.format(when),
|
||||
'created': ' since {}'.format(when)
|
||||
}.get(status, when)
|
||||
|
||||
|
||||
def format_notification_status_as_field_status(status):
|
||||
|
||||
@@ -94,6 +94,13 @@
|
||||
|
||||
}
|
||||
|
||||
.status-hint {
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
color: $red;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&-yes,
|
||||
|
||||
@@ -57,13 +57,17 @@
|
||||
{% if item.status|format_notification_status_as_url %}
|
||||
<a href="{{ item.status|format_notification_status_as_url }}">
|
||||
{% endif %}
|
||||
{{ item.status|format_notification_status_with_time(
|
||||
item.template.template_type,
|
||||
(item.updated_at or item.created_at)|format_datetime_short
|
||||
{{ item.status|format_notification_status(
|
||||
item.template.template_type
|
||||
) }}
|
||||
{% if item.status|format_notification_status_as_url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
<span class="status-hint">
|
||||
{{ item.status|format_notification_status_as_time(
|
||||
(item.updated_at or item.created_at)|format_datetime_short
|
||||
) }}
|
||||
</span>
|
||||
{% endcall %}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
@@ -75,13 +75,18 @@
|
||||
{% if item.status|format_notification_status_as_url %}
|
||||
<a href="{{ item.status|format_notification_status_as_url }}">
|
||||
{% endif %}
|
||||
{{ item.status|format_notification_status_with_time(
|
||||
item.template.template_type,
|
||||
(item.updated_at or item.created_at)|format_datetime_short
|
||||
{{ item.status|format_notification_status(
|
||||
item.template.template_type
|
||||
) }}
|
||||
{% if item.status|format_notification_status_as_url %}
|
||||
</a>
|
||||
<br>
|
||||
{% endif %}
|
||||
<span class="status-hint">
|
||||
{{ item.status|format_notification_status_as_time(
|
||||
(item.updated_at or item.created_at)|format_datetime_short
|
||||
) }}
|
||||
</span>
|
||||
{% endcall %}
|
||||
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user