Files
notifications-admin/app/templates/views/activity/all-activity.html

264 lines
12 KiB
HTML
Raw Normal View History

2024-07-18 15:57:29 -07:00
{% extends "withnav_template.html" %}
{% block service_page_title %}
All activity
{% endblock %}
{% set show_pagination %}
{% if prev_page or next_page %}
<nav aria-label="Pagination" class="usa-pagination">
<ul class="usa-pagination__list">
{% if prev_page %}
<li class="usa-pagination__item usa-pagination__arrow">
<a
href="{{prev_page['url']}}"
class="usa-pagination__link usa-pagination__previous-page"
aria-label="Previous page"
>
2024-08-15 10:16:02 -07:00
<img src="{{ asset_url('img/usa-icons/navigate_before.svg') }}" alt="arrow">
2024-07-18 15:57:29 -07:00
<span class="usa-pagination__link-text">Previous</span></a
>
</li>
{% endif %}
{% if pagination %}
{% for page in pagination.pages %}
{% if page == pagination.current %}
<li class="usa-pagination__item usa-pagination__page-no">
<span class="usa-pagination__button usa-current" aria-label="Page {{ page }}" aria-current="true">
{{ page }}
</span>
</li>
{% else %}
<li class="usa-pagination__item">
<a class="usa-pagination__button" href="?page={{ page }}{% if request.args.get('filter') %}&filter={{ request.args.get('filter') }}{% endif %}">
2024-07-18 15:57:29 -07:00
{{ page }}
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% if next_page %}
<li class="usa-pagination__item usa-pagination__arrow">
<a
href="{{ next_page['url'] }}"
class="usa-pagination__link usa-pagination__next-page"
aria-label="Next page"
>
<span class="usa-pagination__link-text">Next </span>
2024-08-15 10:16:02 -07:00
<img src="{{ asset_url('img/usa-icons/navigate_next.svg') }}" alt="arrow">
2024-07-18 15:57:29 -07:00
</a>
</li>
{% endif %}
</ul>
</nav>
{% if pagination and total_jobs %}
2025-08-07 10:15:11 -07:00
<p class="text-center font-body-sm">
Page <span class="text-bold">{{ pagination.current }}</span> of <span class="text-bold">{{ pagination.last }}</span> (<span>{{ total_jobs }}</span> total jobs)
</p>
{% endif %}
2024-07-18 15:57:29 -07:00
{% endif %}
{% endset %}
{% block maincolumn_content %}
2024-07-24 14:29:05 -07:00
<div class="margin-bottom-8">
2024-07-18 15:57:29 -07:00
<h1 class="usa-sr-only">All activity</h1>
<h2 class="font-body-2xl line-height-sans-2 margin-0">All activity</h2>
<h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
<div class="flex-wrap gap-3 display-flex flex-align-start margin-top-2">
<div class="flex-1">
<ul class="usa-button-group usa-button-group--segmented">
<li class="usa-button-group__item">
<a href="{{ url_for('main.all_jobs_activity', service_id=current_service.id) }}"
class="usa-button usa-button--small {% if not request.args.get('filter') %}{% else %}usa-button--outline{% endif %}">
All
</a>
</li>
<li class="usa-button-group__item">
<a href="{{ url_for('main.all_jobs_activity', service_id=current_service.id, filter='24hours') }}"
class="usa-button usa-button--small {% if request.args.get('filter') == '24hours' %}{% else %}usa-button--outline{% endif %}">
Last 24 hours
</a>
</li>
<li class="usa-button-group__item">
<a href="{{ url_for('main.all_jobs_activity', service_id=current_service.id, filter='3days') }}"
class="usa-button usa-button--small {% if request.args.get('filter') == '3days' %}{% else %}usa-button--outline{% endif %}">
Last 3 days
</a>
</li>
<li class="usa-button-group__item">
<a href="{{ url_for('main.all_jobs_activity', service_id=current_service.id, filter='7days') }}"
class="usa-button usa-button--small {% if request.args.get('filter') == '7days' %}{% else %}usa-button--outline{% endif %}">
Last 7 days
</a>
</li>
</ul>
</div>
</div>
2025-08-07 11:04:42 -07:00
<div class="usa-table-container--scrollable-mobile table-overflow-x-auto">
2024-07-25 00:30:31 -07:00
<table class="usa-table usa-table--compact job-table">
<caption class="usa-sr-only">Table showing all sent jobs for this service</caption>
2024-07-18 15:57:29 -07:00
<thead class="table-field-headings">
<tr>
2024-07-24 14:29:05 -07:00
<th scope="col" role="columnheader" class="table-field-heading-first" id="jobId">
2024-07-18 15:57:29 -07:00
<span>Job ID#</span>
</th>
2025-08-07 12:30:25 -07:00
<th scope="col" role="columnheader" class="table-field-heading">
2024-07-18 15:57:29 -07:00
<span>Template</span>
</th>
2025-08-07 12:30:25 -07:00
<th scope="col" role="columnheader" class="table-field-heading">
2025-06-25 14:01:23 -07:00
<span>Started</span>
2024-07-18 15:57:29 -07:00
</th>
2025-08-07 12:30:25 -07:00
<th scope="col" role="columnheader" class="table-field-heading">
2024-07-18 15:57:29 -07:00
<span>Sender</span>
</th>
2025-08-07 12:30:25 -07:00
<th scope="col" role="columnheader" class="table-field-heading">
2024-07-23 12:01:40 -07:00
<span>Report</span>
2024-07-18 15:57:29 -07:00
</th>
2025-08-07 12:30:25 -07:00
<th scope="col" role="columnheader" class="table-field-heading">
2025-08-07 09:57:44 -07:00
<span>Status</span>
</th>
2024-07-18 15:57:29 -07:00
</tr>
</thead>
<tbody>
{% if all_jobs_dict %}
{% for job in all_jobs_dict %}
2024-07-24 14:29:05 -07:00
<tr class="table-row">
2025-08-07 09:57:44 -07:00
<td class="table-field width-5" role="rowheader">
2024-07-24 14:29:05 -07:00
<a class="usa-link" href="{{ job.view_job_link }}">
{{ job.job_id[:8] if job.job_id else 'Manually entered number' }}
2024-07-23 12:01:40 -07:00
</a>
2024-07-18 15:57:29 -07:00
</td>
2025-08-07 09:57:44 -07:00
<td class="table-field width-16">{{ job.template_name }}</td>
<td data-sort-value="{{ job.activity_time | convert_time_unixtimestamp }}" class="table-field width-18">
{{ job.activity_time|format_datetime_table }}
2024-07-18 15:57:29 -07:00
</td>
2025-08-07 09:57:44 -07:00
<td class="table-field width-30 ">{{ job.created_by.name }}</td>
<td class="text-center table-field width-2">
{% if job.can_download %}
<a href="{{ job.download_link }}">
<img src="{{ url_for('static', filename='img/material-icons/file_download.svg') }}" alt="" class="padding-top-05">
<span class="usa-sr-only">Download report link</span>
</a>
2024-08-16 11:01:00 -07:00
{% else %}
2024-07-23 12:01:40 -07:00
<span>N/A</span>
2024-07-18 15:57:29 -07:00
{% endif %}
</td>
2025-08-07 09:57:44 -07:00
<td class="table-field width-15">
2025-08-07 10:55:40 -07:00
<span class="bg-base-lighter padding-x-05 padding-y-0 font-body-3xs text-bold radius-sm margin-right-05 display-inline-block text-nowrap">
2025-08-07 09:57:44 -07:00
{{ job.delivered_count if job.delivered_count is not none else '0' }} delivered
</span>
2025-08-07 10:55:40 -07:00
<span class="bg-base-lighter padding-x-05 padding-y-0 font-body-3xs text-bold radius-sm display-inline-block text-nowrap">
2025-08-07 09:57:44 -07:00
{{ job.failed_count if job.failed_count is not none else '0' }} failed
</span>
</td>
2024-07-18 15:57:29 -07:00
</tr>
{% endfor %}
{% else %}
2024-07-25 17:09:17 -07:00
<tr class="table-row">
2024-08-22 15:46:17 -07:00
<td class="table-empty-message" colspan="10">No messages found</td>
2024-07-25 17:09:17 -07:00
</tr>
2024-08-16 11:01:00 -07:00
{% endif %}
2024-07-18 15:57:29 -07:00
</tbody>
</table>
2024-07-23 12:01:40 -07:00
<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>
2025-08-07 10:15:11 -07:00
<p class="font-body-sm"><b>Note: </b>Report data is only available for 7 days after your message has been sent</p>
2024-07-18 15:57:29 -07:00
</div>
{{show_pagination}}
{% if current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) %}
<div class="usa-summary-box margin-top-4" role="region" aria-labelledby="download-reports-heading">
<div class="usa-summary-box__body">
<h2 class="usa-summary-box__heading" id="download-reports-heading">Download recent reports</h2>
<div class="usa-summary-box__text">
<p class="font-body-xs margin-bottom-3">
Reports are automatically generated daily at midnight and include data through the previous day.
Today's activity will appear in tomorrow's report.
</p>
<div class="download-reports-container maxw-tablet-lg">
<div class="margin-bottom-2">
{% if report_1_day.available %}
<a href="{{ download_link_one_day }}"
class="usa-button width-full display-flex flex-align-center"
download
aria-label="Download yesterday's report, CSV format, {{ report_1_day.size }}">
<svg class="usa-icon margin-right-2" aria-hidden="true" focusable="false" role="img">
<use xlink:href="{{ asset_url('img/sprite.svg') }}#file_download"></use>
</svg>
<span>Yesterday&nbsp; - {{ report_1_day.size }}</span>
</a>
{% else %}
<button class="usa-button width-full"
disabled
aria-label="Yesterday's report not available - no messages were sent">
Yesterday&nbsp; - &nbsp;No messages sent
</button>
{% endif %}
</div>
<div class="margin-bottom-2">
{% if report_3_day.available %}
<a href="{{ download_link_three_day }}"
class="usa-button width-full display-flex flex-align-center"
download
aria-label="Download last 3 days report, CSV format, {{ report_3_day.size }}">
<svg class="usa-icon margin-right-2" aria-hidden="true" focusable="false" role="img">
<use xlink:href="{{ asset_url('img/sprite.svg') }}#file_download"></use>
</svg>
<span>Last 3 days - {{ report_3_day.size }}</span>
</a>
{% else %}
<button class="usa-button width-full"
disabled
aria-label="Last 3 days report not available - no messages were sent">
Last 3 days - No messages sent
</button>
{% endif %}
</div>
<div class="margin-bottom-2">
{% if report_5_day.available %}
<a href="{{ download_link_five_day }}"
class="usa-button width-full display-flex flex-align-center"
download
aria-label="Download last 5 days report, CSV format, {{ report_5_day.size }}">
<svg class="usa-icon margin-right-2" aria-hidden="true" focusable="false" role="img">
<use xlink:href="{{ asset_url('img/sprite.svg') }}#file_download"></use>
</svg>
<span>Last 5 days - {{ report_5_day.size }}</span>
</a>
{% else %}
<button class="usa-button width-full"
disabled
aria-label="Last 5 days report not available - no messages were sent">
Last 5 days - No messages sent
</button>
{% endif %}
</div>
<div class="margin-bottom-2">
{% if report_7_day.available %}
<a href="{{ download_link_seven_day }}"
class="usa-button width-full display-flex flex-align-center"
download
aria-label="Download last 7 days report, CSV format, {{ report_7_day.size }}">
<svg class="usa-icon margin-right-2" aria-hidden="true" focusable="false" role="img">
<use xlink:href="{{ asset_url('img/sprite.svg') }}#file_download"></use>
</svg>
<span>Last 7 days - {{ report_7_day.size }}</span>
</a>
{% else %}
<button class="usa-button width-full"
disabled
aria-label="Last 7 days report not available - no messages were sent">
Last 7 days - No messages sent
</button>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endif %}
2024-07-18 15:57:29 -07:00
</div>
{% endblock %}