mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Sending notifications don’t have an `updated_at`. This causes the time formatting to throw a wobly, because it doesn’t expect `None`. This commit changes the template to also look for the `created_at`, which all notifications have.
59 lines
1.7 KiB
HTML
59 lines
1.7 KiB
HTML
{% from "components/table.html" import list_table, field, right_aligned_field_heading %}
|
|
|
|
<div
|
|
{% if not finished %}
|
|
data-module="update-content"
|
|
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
|
|
data-key="notifications"
|
|
aria-live="polite"
|
|
{% endif %}
|
|
>
|
|
|
|
<div>
|
|
{% if notifications|length > 0 and notifications[0].job_row_number is not none %}
|
|
{% call(item, row_number) list_table(
|
|
notifications,
|
|
caption=uploaded_file_name,
|
|
caption_visible=False,
|
|
empty_message="No messages to show yet",
|
|
field_headings=[
|
|
'Recipient',
|
|
right_aligned_field_heading('Status')
|
|
]
|
|
) %}
|
|
{% call field() %}
|
|
{{ item.to }}
|
|
{% endcall %}
|
|
{% call field(
|
|
align='right',
|
|
status='error' if item.status == 'Failed' else 'default'
|
|
) %}
|
|
{{ item.status|format_notification_status }} at {{ (item.updated_at or item.created_at)|format_time }}
|
|
{% endcall %}
|
|
{% endcall %}
|
|
{% else %}
|
|
{% call(item, row_number) list_table(
|
|
notifications,
|
|
caption=uploaded_file_name,
|
|
caption_visible=False,
|
|
empty_message="No messages to show yet",
|
|
field_headings=[
|
|
'Recipient',
|
|
right_aligned_field_heading('Status')
|
|
]
|
|
) %}
|
|
{% call field() %}
|
|
{{ item.to }}
|
|
{% endcall %}
|
|
{% call field(
|
|
align='right',
|
|
status='error' if item.status == 'Failed' else 'default'
|
|
) %}
|
|
{{ item.status|format_notification_status }} at {{ item.updated_at|format_time }}
|
|
{% endcall %}
|
|
{% endcall %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|