mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-24 19:20:01 -04:00
Colour code notification statuses
Makes the table easier to scan. Delivered stays as before. Sending is greyed out. All other statuses are failure, and stand out by being red and bold.
This commit is contained in:
@@ -111,6 +111,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_as_field_status)
|
||||
|
||||
application.after_request(useful_headers_after_request)
|
||||
application.after_request(save_service_after_request)
|
||||
@@ -250,6 +251,17 @@ def format_notification_status(status, template_type):
|
||||
}.get(template_type).get(status, status)
|
||||
|
||||
|
||||
def format_notification_status_as_field_status(status):
|
||||
return {
|
||||
'failed': 'error',
|
||||
'technical-failure': 'error',
|
||||
'temporary-failure': 'error',
|
||||
'permanent-failure': 'error',
|
||||
'delivered': None,
|
||||
'sending': 'default'
|
||||
}.get(status, 'error')
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
return user_api_client.get_user(user_id)
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
(item.updated_at or item.created_at)|format_datetime_short
|
||||
) }}
|
||||
|
||||
{% call field(status='', align='right') %}
|
||||
{% call field(status=item.status|format_notification_status_as_field_status, align='right') %}
|
||||
{{ item.status|format_notification_status(item.template.template_type) }}
|
||||
{% endcall %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user