Files
notifications-admin/app/templates/views/dashboard/_jobs.html
2023-08-23 16:18:25 -04:00

67 lines
2.0 KiB
HTML

{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading %}
{% from "components/big-number.html" import big_number -%}
<div class='dashboard-table ajax-block-container'>
{% call(item, row_number) list_table(
jobs,
caption="Recent files uploaded",
caption_visible=False,
empty_message=(
'You have not uploaded any files yet.'
),
field_headings=[
'File',
'Status'
],
field_headings_visible=False
) %}
{% call row_heading() %}
<div class="file-list">
<a class="file-list-filename-large usa-link" href="{{ url_for('.view_job', service_id=current_service.id, job_id=item.id) }}">{{ item.original_file_name }}</a>
{% if item.scheduled %}
<span class="file-list-hint-large">
Sending {{
item.scheduled_for|format_datetime_relative
}}
</span>
{% else %}
<span class="file-list-hint-large">
Sent {{
(item.scheduled_for or item.created_at)|format_datetime_relative
}}
</span>
{% endif %}
</div>
{% endcall %}
{% call field() %}
{% if item.scheduled %}
{{ big_number(
item.notification_count,
smallest=True,
label=item.notification_count|message_count_label(
item.template_type,
suffix='waiting to send'
)
) }}
{% else %}
<div class="grid-row">
<div class="grid-col-4">
{{ big_number(
item.notifications_sending,
smallest=True,
label='pending',
) }}
</div>
<div class="grid-col-4">
{{ big_number(item.notifications_delivered, smallest=True, label='delivered') }}
</div>
<div class="grid-col-4">
{{ big_number(item.notifications_failed, smallest=True, label='failed') }}
</div></div>
{% endif %}
{% endcall %}
{% endcall %}
</div>