Files
notifications-admin/app/templates/views/dashboard/dashboard.html
T

111 lines
3.9 KiB
HTML
Raw Normal View History

2016-03-17 11:45:48 +00:00
{% extends "withnav_template.html" %}
2024-01-03 00:26:49 -08:00
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading, row_heading, notification_status_field, notification_carrier_field, notification_carrier_message_field %}
2016-06-28 09:21:46 +01:00
{% from "components/ajax-block.html" import ajax_block %}
2016-06-28 08:59:08 +01:00
2017-02-13 10:45:15 +00:00
{% block service_page_title %}
Dashboard
2016-03-17 11:45:48 +00:00
{% endblock %}
{% block maincolumn_content %}
2023-06-08 13:12:00 -04:00
<div class="dashboard margin-bottom-8">
2016-04-20 15:37:17 +01:00
2023-06-08 13:12:00 -04:00
<h1 class="usa-sr-only">Dashboard</h1>
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
{% include 'views/dashboard/write-first-messages.html' %}
{% endif %}
2016-03-17 11:45:48 +00:00
{{ ajax_block(partials, updates_url, 'upcoming') }}
2016-08-09 10:39:57 +01:00
<h2 class="font-body-xl margin-0">
Messages sent
</h2>
<p class="margin-top-0">In the last seven days</p>
2016-06-28 08:59:08 +01:00
{{ ajax_block(partials, updates_url, 'inbox') }}
2017-05-22 17:02:03 +01:00
{{ ajax_block(partials, updates_url, 'totals') }}
2016-06-28 08:59:08 +01:00
{{ ajax_block(partials, updates_url, 'template-statistics') }}
2024-01-03 00:26:49 -08:00
<h2 class="margin-top-4 margin-bottom-1">Batched Jobs</h2>
2024-01-04 13:40:36 -08:00
{% if notifications %}
2024-01-03 00:26:49 -08:00
<div class='job-table'>
{% endif %}
{% call(item, row_number) list_table(
2024-01-04 13:40:36 -08:00
notifications,
2024-01-03 00:26:49 -08:00
caption="Batched Jobs",
caption_visible=False,
border_visible=True,
empty_message='No batched job messages found &thinsp;(messages are kept for {} days)'.format(limit_days)|safe,
field_headings=['Template Name','Date/Time', 'Download (CSV) Report'],
field_headings_visible=False
) %}
2024-01-04 13:40:36 -08:00
{% if item.job.original_file_name and item.job.id %}
2024-01-03 00:26:49 -08:00
{% call row_heading() %}
<a class="usa-link file-list-filename" href="/services/{{ item.service }}/jobs/{{ item.job.id }}">{{ item.job.original_file_name|replace('.csv', '') if item.job.id else '' }}</a>
{% endcall %}
{% call row_heading() %}
{{ item.status|format_notification_status_as_time(
item.created_at|format_datetime_short,
(item.updated_at or item.created_at)|format_datetime_short
) }}
{% endcall %}
{% call row_heading() %}
<a class="usa-link file-list-filename" href="/services/{{ item.service }}/jobs/{{ item.job.id }}.csv">{{ "Download" if item.job.original_file_name else '' }}</a>
2024-01-04 13:40:36 -08:00
{% set availability = download_availability|selectattr('job_id', 'equalto', item.job.id)|first %}
{% if availability %}
<span>- {{ availability.time_left }}</span>
{% endif %}
2024-01-03 00:26:49 -08:00
{% endcall %}
{% endif %}
{% endcall %}
{% if batched %}
</div>
{% endif %}
{% if show_pagination %}
{{ previous_next_navigation(prev_page, next_page) }}
{% elif next_page %}
<p class="table-show-more-link">
Only showing the first 50 messages
</p>
{% endif %}
2023-11-01 10:38:50 -04:00
<h2 class="margin-top-4 margin-bottom-1">Usage</h2>
<h3 class="margin-bottom-0">Daily</h3>
<p class="margin-0">Across all services</p>
2023-11-01 10:38:50 -04:00
<table class="usa-table usa-table--borderless margin-top-1 margin-bottom-5">
<caption class="usa-sr-only">
Daily
</caption>
<thead>
<tr>
<th scope="col">Usage</th>
<th scope="col">Remaining</th>
</tr>
</thead>
<tbody>
<tr>
2023-11-16 12:02:59 -05:00
<td>{{ global_message_limit - daily_global_messages_remaining }}</td>
<td>
{{ daily_global_messages_remaining }}
</td>
</tr>
</tbody>
</table>
2019-10-25 13:27:46 +01:00
{% if current_user.has_permissions('manage_service') %}
2023-11-16 12:02:59 -05:00
<h3 class='margin-bottom-0' id="current-year"></h3>
{{ ajax_block(partials, updates_url, 'usage') }}
2023-12-18 21:56:40 -05:00
<a
href="{{ url_for('.usage', service_id=current_service['id']) }}"
class="usa-link show-more"
><span>See all usage</span></a>
2019-10-25 13:27:46 +01:00
{% endif %}
2016-04-20 15:37:17 +01:00
</div>
2016-03-17 11:45:48 +00:00
{% endblock %}