mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-15 19:01:04 -04:00
116 lines
4.5 KiB
HTML
116 lines
4.5 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=(
|
|
'Upload a letter and Notify will print, pack and post it for you.' if current_service.has_permission('letter') else 'You have not uploaded any files yet.'
|
|
),
|
|
field_headings=[
|
|
'File',
|
|
'Status'
|
|
],
|
|
field_headings_visible=False
|
|
) %}
|
|
{% call row_heading() %}
|
|
<div class="file-list">
|
|
{% if item.upload_type == 'letter_day' %}
|
|
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('.uploaded_letters', service_id=current_service.id, letter_print_day=item.created_at|format_date_numeric) }}">{{ item.original_file_name }}</a>
|
|
{% elif item.upload_type == 'letter' %}
|
|
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('.view_notification', service_id=current_service.id, notification_id=item.id) }}">{{ item.original_file_name }}</a>
|
|
{% elif item.upload_type == 'contact_list' %}
|
|
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('.contact_list', service_id=current_service.id, contact_list_id=item.id) }}">{{ item.original_file_name }}</a>
|
|
{% else %}
|
|
<a class="file-list-filename-large govuk-link govuk-link--no-visited-state" href="{{ url_for('.view_job', service_id=current_service.id, job_id=item.id) }}">{{ item.original_file_name }}</a>
|
|
{% endif %}
|
|
{% if item.scheduled %}
|
|
<span class="file-list-hint-large">
|
|
Sending {{
|
|
item.scheduled_for|format_datetime_relative
|
|
}}
|
|
</span>
|
|
{% elif item.upload_type == 'contact_list' %}
|
|
<span class="file-list-hint-large">
|
|
{% if item.recent_job_count %}
|
|
Used {{ item.recent_job_count|iteration_count }}
|
|
in the last
|
|
{{ current_service.get_days_of_retention(item.template_type) }}
|
|
days
|
|
{% elif item.has_jobs %}
|
|
Not used in the last
|
|
{{ current_service.get_days_of_retention(item.template_type) }}
|
|
days
|
|
{% else %}
|
|
Not used yet
|
|
{% endif %}
|
|
{% elif item.upload_type == 'letter_day' %}
|
|
<span class="file-list-hint-large">
|
|
{{ item.letter_printing_statement }}
|
|
</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'
|
|
)
|
|
) }}
|
|
{% elif item.template_type == 'letter' %}
|
|
{{ big_number(
|
|
item.notification_count,
|
|
smallest=True,
|
|
label=item.notification_count|message_count_label(
|
|
item.template_type,
|
|
suffix=''
|
|
)
|
|
) }}
|
|
{% elif item.upload_type == 'contact_list' %}
|
|
{{ big_number(
|
|
item.row_count,
|
|
smallest=True,
|
|
label="saved {}".format(item.row_count|recipient_count_label(item.template_type))
|
|
) }}
|
|
{% elif item.pdf_letter %}
|
|
<p class="govuk-body letter-recipient-summary">
|
|
{% for line in item.recipient.splitlines() %}
|
|
{% if loop.index < 3 %}
|
|
{{ line }}<br>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</p>
|
|
{% else %}
|
|
<div class="govuk-grid-row">
|
|
<div class="govuk-grid-column-one-third">
|
|
{{ big_number(
|
|
item.notifications_sending,
|
|
smallest=True,
|
|
label='sending',
|
|
) }}
|
|
</div>
|
|
<div class="govuk-grid-column-one-third">
|
|
{{ big_number(item.notifications_delivered, smallest=True, label='delivered') }}
|
|
</div>
|
|
<div class="govuk-grid-column-one-third">
|
|
{{ big_number(item.notifications_failed, smallest=True, label='failed') }}
|
|
</div></div>
|
|
|
|
{% endif %}
|
|
{% endcall %}
|
|
{% endcall %}
|
|
</div>
|