mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-30 02:50:03 -04:00
This should: - make the page load faster because it has to render less HTML for each service - make the page easier to scan for services that are sending lots of text messages or letters We used to scan this page to look for services with high failure rates, and the design of the page was gear towards this. Now we have alerting for high failure rates, so the page can focus on volumes instead. This commit also puts the service name above the statistics, so that long service names don’t break the layout of the page.
89 lines
2.8 KiB
HTML
89 lines
2.8 KiB
HTML
{% extends "views/platform-admin/_base_template.html" %}
|
|
{% from "components/textbox.html" import textbox %}
|
|
{% from "components/checkbox.html" import checkbox %}
|
|
{% from "components/page-footer.html" import page_footer %}
|
|
{% from "components/big-number.html" import big_number, big_number_with_status %}
|
|
{% from "components/message-count-label.html" import message_count_label %}
|
|
{% from "components/table.html" import mapping_table, field, stats_fields, row_group, row, right_aligned_field_heading, hidden_field_heading, text_field %}
|
|
{% from "components/form.html" import form_wrapper %}
|
|
{% from "components/button/macro.njk" import govukButton %}
|
|
{% from "components/details/macro.njk" import govukDetails %}
|
|
|
|
{% macro services_table(services, caption) %}
|
|
{% call(item, row_number) mapping_table(
|
|
caption=caption,
|
|
caption_visible=False,
|
|
field_headings=[
|
|
right_aligned_field_heading('Emails'),
|
|
right_aligned_field_heading('Text messages'),
|
|
right_aligned_field_heading('Letters')
|
|
],
|
|
field_headings_visible=False,
|
|
) %}
|
|
|
|
{% for service in services %}
|
|
|
|
{% call row_group() %}
|
|
|
|
{% call row() %}
|
|
{% call field(border=False, colspan=3) %}
|
|
<a href="{{ url_for('main.service_dashboard', service_id=service['id']) }}" class="file-list-filename-large govuk-link govuk-link--no-visited-state govuk-!-padding-bottom-4">{{ service['name'] }}</a>
|
|
{% if not service['active'] %}
|
|
<span class="heading-medium hint"> Archived</span>
|
|
{% endif %}
|
|
{% endcall %}
|
|
|
|
{% endcall %}
|
|
|
|
{% call row() %}
|
|
{% for channel in ('email', 'sms', 'letter') %}
|
|
{% call field(border=False) %}
|
|
{{ big_number(
|
|
service['stats'][channel]['requested'],
|
|
smallest=True,
|
|
label=message_count_label(service['stats'][channel]['requested'], channel)
|
|
) }}
|
|
{% endcall %}
|
|
{% endfor %}
|
|
{% endcall %}
|
|
|
|
{% endcall %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endcall %}
|
|
{% endmacro %}
|
|
|
|
|
|
{% block per_page_title %}
|
|
{{ page_title|capitalize }}
|
|
{% endblock %}
|
|
|
|
{% block platform_admin_content %}
|
|
|
|
<h1 class="heading-medium">
|
|
{{ page_title|capitalize }}
|
|
</h1>
|
|
|
|
|
|
{% set details_content %}
|
|
{% call form_wrapper(method="get") %}
|
|
{{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }}
|
|
{{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }}
|
|
{{ checkbox(form.include_from_test_key) }}
|
|
</br>
|
|
{{ govukButton({ "text": "Filter" }) }}
|
|
{% endcall %}
|
|
{% endset %}
|
|
|
|
{{ govukDetails({
|
|
"summaryText": "Apply filters",
|
|
"html": details_content
|
|
}) }}
|
|
|
|
{% include "views/platform-admin/_global_stats.html" %}
|
|
|
|
{{ services_table(services, page_title|capitalize) }}
|
|
|
|
{% endblock %}
|