2024-08-23 14:01:51 -07:00
|
|
|
|
2024-08-23 11:03:32 -07:00
|
|
|
|
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 %}
|
2024-08-27 12:47:15 -07:00
|
|
|
<script type="text/javascript" src="{{ asset_url('js/setTimezone.js') }}"></script>
|
|
|
|
|
|
2016-04-05 11:40:13 +01:00
|
|
|
|
2024-11-22 16:45:25 -05:00
|
|
|
<div class="dashboard margin-top-0 margin-bottom-2">
|
2016-04-20 15:37:17 +01:00
|
|
|
|
2023-06-08 13:12:00 -04:00
|
|
|
<h1 class="usa-sr-only">Dashboard</h1>
|
2018-11-05 15:26:59 +00:00
|
|
|
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
|
2018-03-12 15:49:52 +00:00
|
|
|
{% include 'views/dashboard/write-first-messages.html' %}
|
2016-04-01 10:54:55 +01:00
|
|
|
{% endif %}
|
2016-03-17 11:45:48 +00:00
|
|
|
|
2020-04-08 17:55:53 +01:00
|
|
|
{{ ajax_block(partials, updates_url, 'upcoming') }}
|
2016-08-09 10:39:57 +01:00
|
|
|
|
2024-11-22 16:45:25 -05:00
|
|
|
<h2 class="font-body-2xl line-height-sans-2 margin-top-0">{{ current_service.name }} Dashboard</h2>
|
2024-06-13 10:29:59 -04:00
|
|
|
|
2024-06-17 13:57:54 -04:00
|
|
|
{{ ajax_block(partials, updates_url, 'inbox') }}
|
|
|
|
|
|
2024-07-17 12:18:05 -04:00
|
|
|
<div id="totalMessageChartContainer" data-sms-sent="{{ sms_sent }}" data-sms-allowance-remaining="{{ sms_allowance_remaining }}">
|
2024-08-14 16:11:00 -04:00
|
|
|
<h2 id="chartTitle">Total messages</h2>
|
2024-07-17 12:18:05 -04:00
|
|
|
<svg id="totalMessageChart"></svg>
|
|
|
|
|
<div id="message"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="totalMessageTable" class="margin-0"></div>
|
2024-06-17 13:57:54 -04:00
|
|
|
|
2024-08-23 18:36:16 -07:00
|
|
|
<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">Recent activity</h2>
|
2024-08-14 13:45:24 -07:00
|
|
|
<div id="activityChartContainer">
|
2024-06-17 09:29:08 -04:00
|
|
|
<form class="usa-form">
|
|
|
|
|
<label class="usa-label" for="options">Account</label>
|
|
|
|
|
<select class="usa-select margin-bottom-2" name="options" id="options">
|
2024-10-08 16:05:00 -04:00
|
|
|
<option value disabled>- Select -</option>
|
2024-06-17 09:29:08 -04:00
|
|
|
<option value="service" selected>{{ current_service.name }}</option>
|
|
|
|
|
<option value="individual">{{ current_user.name }}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</form>
|
2024-07-17 12:18:05 -04:00
|
|
|
<div id="activityChart">
|
2024-06-17 13:57:54 -04:00
|
|
|
<div class="chart-header">
|
2024-08-14 16:11:00 -04:00
|
|
|
<div class="chart-subtitle">{{ current_service.name }} - last 7 days</div>
|
2024-09-23 08:01:56 -07:00
|
|
|
<div class="chart-legend" role="region" aria-label="Legend"></div>
|
2024-06-17 13:57:54 -04:00
|
|
|
</div>
|
2024-07-23 15:55:09 -04:00
|
|
|
<div class="chart-container" id="weeklyChart"></div>
|
2024-06-27 11:01:31 -04:00
|
|
|
<table id="weeklyTable" class="usa-sr-only usa-table"></table>
|
2024-06-13 10:29:59 -04:00
|
|
|
</div>
|
2024-05-24 10:29:01 -04:00
|
|
|
</div>
|
2024-06-27 11:01:31 -04:00
|
|
|
<div id="aria-live-account" class="usa-sr-only" aria-live="polite"></div>
|
2024-05-14 15:45:33 -04:00
|
|
|
|
2024-07-17 12:18:05 -04:00
|
|
|
{% if current_user.has_permissions('manage_service') %}{% endif %}
|
|
|
|
|
|
2024-07-31 16:00:06 -04:00
|
|
|
<div class="table-container">
|
2024-08-05 16:05:54 -04:00
|
|
|
<div id="table1" class="table-overflow-x-auto hidden">
|
2024-08-14 16:11:00 -04:00
|
|
|
<h2 class="margin-top-4 margin-bottom-1">My activity</h2>
|
2024-07-31 16:00:06 -04:00
|
|
|
<table class="usa-table job-table">
|
2024-10-08 16:05:00 -04:00
|
|
|
<caption class="usa-sr-only">Table showing the sent jobs for {{current_user.name}}</caption>
|
2024-07-31 16:00:06 -04:00
|
|
|
<thead class="table-field-headings">
|
|
|
|
|
<tr>
|
2024-08-07 16:20:40 -04:00
|
|
|
<th scope="col" class="table-field-heading-first" id="jobId"><span>Job ID#</span></th>
|
|
|
|
|
<th data-sortable scope="col" class="table-field-heading"><span>Template</span></th>
|
|
|
|
|
<th data-sortable scope="col" class="table-field-heading"><span>Job status</span></th>
|
|
|
|
|
<th data-sortable scope="col" class="table-field-heading"><span># of Recipients</span></th>
|
2024-07-31 16:00:06 -04:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% if jobs %}
|
|
|
|
|
{% for job in jobs[:5] %}
|
|
|
|
|
{% if job.created_by.name == current_user.name %}
|
|
|
|
|
{% set notification = job.notifications[0] %}
|
|
|
|
|
<tr id="{{ job.job_id }}">
|
2024-10-08 11:32:55 -07:00
|
|
|
<td class="table-field jobid" role="rowheader">
|
2024-08-07 16:20:40 -04:00
|
|
|
<a class="usa-link" href="{{ job.view_job_link }}">
|
|
|
|
|
{{ job.job_id[:8] if job.job_id else 'Manually entered number' }}
|
|
|
|
|
</a>
|
2024-07-31 16:00:06 -04:00
|
|
|
</td>
|
|
|
|
|
<td class="table-field template">{{ job.template_name }}</td>
|
2024-08-08 14:42:15 -04:00
|
|
|
<td class="table-field time-sent">Sent on
|
2024-07-31 16:00:06 -04:00
|
|
|
{{ (job.processing_finished if job.processing_finished else job.processing_started
|
|
|
|
|
if job.processing_started else job.created_at)|format_datetime_table }}
|
|
|
|
|
</td>
|
|
|
|
|
<td class="table-field count-of-recipients">{{ job.notification_count }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% else %}
|
|
|
|
|
<tr class="table-row">
|
|
|
|
|
<td class="table-empty-message" colspan="10">No batched job messages found  (messages are kept for {{ service_data_retention_days }} days).</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-08-05 16:05:54 -04:00
|
|
|
<div id="table2" class="table-overflow-x-auto visible">
|
2024-08-14 16:11:00 -04:00
|
|
|
<h2 class="margin-top-4 margin-bottom-1">Service activity</h2>
|
2024-07-31 16:00:06 -04:00
|
|
|
<table class="usa-table job-table">
|
2024-10-08 16:05:00 -04:00
|
|
|
<caption class="usa-sr-only">Table showing the sent jobs for this service</caption>
|
2024-07-31 16:00:06 -04:00
|
|
|
<thead class="table-field-headings">
|
|
|
|
|
<tr>
|
2024-08-07 16:20:40 -04:00
|
|
|
<th scope="col" role="columnheader" class="table-field-heading-first" id="jobId"><span>Job ID#</span></th>
|
|
|
|
|
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Template</span></th>
|
|
|
|
|
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Job status</span></th>
|
|
|
|
|
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Sender</span></th>
|
|
|
|
|
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span># of Recipients</span></th>
|
2024-07-31 16:00:06 -04:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% if jobs %}
|
|
|
|
|
{% for job in jobs[:5] %}
|
2024-02-12 15:29:26 -08:00
|
|
|
{% set notification = job.notifications[0] %}
|
2024-07-11 12:59:14 -04:00
|
|
|
<tr id="{{ job.job_id }}">
|
2024-10-08 11:32:55 -07:00
|
|
|
<td class="table-field jobid" role="rowheader">
|
2024-08-07 16:20:40 -04:00
|
|
|
<a class="usa-link" href="{{ job.view_job_link }}">
|
|
|
|
|
{{ job.job_id[:8] if job.job_id else 'Manually entered number' }}
|
|
|
|
|
</a>
|
2024-02-12 15:29:26 -08:00
|
|
|
</td>
|
2024-07-31 16:00:06 -04:00
|
|
|
<td class="table-field template">{{ job.template_name }}</td>
|
2024-08-08 14:42:15 -04:00
|
|
|
<td class="table-field time-sent">Sent on
|
2024-07-11 12:55:35 -07:00
|
|
|
{{ (job.processing_finished if job.processing_finished else job.processing_started
|
|
|
|
|
if job.processing_started else job.created_at)|format_datetime_table }}
|
2024-02-12 15:29:26 -08:00
|
|
|
</td>
|
2024-07-31 16:00:06 -04:00
|
|
|
<td class="table-field sender">{{ job.created_by.name }}</td>
|
|
|
|
|
<td class="table-field count-of-recipients">{{ job.notification_count }}</td>
|
2024-02-09 17:09:48 -08:00
|
|
|
</tr>
|
2024-07-31 16:00:06 -04:00
|
|
|
{% endfor %}
|
|
|
|
|
{% else %}
|
|
|
|
|
<tr class="table-row">
|
|
|
|
|
<td class="table-empty-message" colspan="10">No batched job messages found  (messages are kept for {{ service_data_retention_days }} days).</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2024-01-12 13:32:10 -08:00
|
|
|
</div>
|
2024-07-11 12:59:14 -04:00
|
|
|
{{ ajax_block(partials, updates_url, 'template-statistics') }}
|
2024-07-17 12:18:05 -04:00
|
|
|
</div>
|
2016-04-20 15:37:17 +01:00
|
|
|
|
2016-03-17 11:45:48 +00:00
|
|
|
{% endblock %}
|