From d381b70abec3cf05bcd6be25784f90e78a644990 Mon Sep 17 00:00:00 2001 From: Jani Kraner Date: Mon, 6 Jul 2026 13:47:27 +0100 Subject: [PATCH 1/2] Replace tables with summary-lists on platform-admin pages Convert tables in the platform admin view to use the summary list component. - app/templates/views/platform-admin/get-dvla-billing-report.html - app/templates/views/platform-admin/get-billing-report.html - app/templates/views/platform-admin/daily-sms-provider-volumes-report.html - app/templates/views/platform-admin/users-list.html - app/templates/views/platform-admin/daily-volumes-report.html - app/templates/views/platform-admin/volumes-by-service-report.html --- .../daily-sms-provider-volumes-report.html | 84 +++++++++++----- .../platform-admin/daily-volumes-report.html | 94 +++++++++++++----- .../platform-admin/get-billing-report.html | 74 +++++++++----- .../get-dvla-billing-report.html | 94 +++++++++++++----- .../views/platform-admin/users-list.html | 97 ++++++++++++++----- .../volumes-by-service-report.html | 94 +++++++++++++----- 6 files changed, 396 insertions(+), 141 deletions(-) diff --git a/app/templates/views/platform-admin/daily-sms-provider-volumes-report.html b/app/templates/views/platform-admin/daily-sms-provider-volumes-report.html index a2d1d500d4..45f5d0a9ab 100644 --- a/app/templates/views/platform-admin/daily-sms-provider-volumes-report.html +++ b/app/templates/views/platform-admin/daily-sms-provider-volumes-report.html @@ -1,7 +1,7 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} -{% from "components/table.html" import mapping_table, row, text_field %} {% from "components/page-footer.html" import page_footer %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} Daily SMS provider volumes Report @@ -22,27 +22,65 @@

Data included in the report

-
- {% call mapping_table( - caption='Descriptions of daily SMS provider volumes data', - field_headings=['Name', 'Description'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for column_heading, description in [ - ('day', 'The whole business day in BST'), - ('provider', 'The SMS provider'), - ('sms totals', 'The number of text messages sent'), - ('sms fragments', 'The number of text message fragments sent'), - ('sms chargeable units', 'The number of text message fragments sent times the rate multiplier'), - ('sms cost', 'The cost to Notify’s users of text messages sent'), - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ + {{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "day" + }, + "value": { + "text": "The whole business day in BST" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "provider" + }, + "value": { + "text": "The SMS provider" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms totals" + }, + "value": { + "text": "The number of text messages sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms fragments" + }, + "value": { + "text": "The number of text message fragments sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms chargeable units" + }, + "value": { + "text": "The number of text message fragments sent times the rate multiplier" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms cost" + }, + "value": { + "text": "The cost to Notify’s users of text messages sent" + } + } + ] + }) }} {% endblock %} diff --git a/app/templates/views/platform-admin/daily-volumes-report.html b/app/templates/views/platform-admin/daily-volumes-report.html index 4e794ccb77..9a1703bb77 100644 --- a/app/templates/views/platform-admin/daily-volumes-report.html +++ b/app/templates/views/platform-admin/daily-volumes-report.html @@ -1,7 +1,7 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} -{% from "components/table.html" import mapping_table, row, text_field %} {% from "components/page-footer.html" import page_footer %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} Daily volumes report @@ -22,28 +22,74 @@

Data included in the report

-
- {% call mapping_table( - caption='Descriptions of daily volumes data', - field_headings=['Name', 'Description'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for column_heading, description in [ - ('day', 'The whole business day in BST.'), - ('sms totals', 'The number of text messages sent'), - ('sms fragments', 'The number of text message fragments sent times the rate multiplier'), - ('sms chargeable units', 'The number of text message fragments sent'), - ('email totals', 'The number of emails sent'), - ('letter totals', 'The number of letters sent'), - ('letter sheet totals', 'The number of sheets sent') - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ + {{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "day" + }, + "value": { + "text": "The whole business day in BST." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms totals" + }, + "value": { + "text": "The number of text messages sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms fragments" + }, + "value": { + "text": "The number of text message fragments sent times the rate multiplier" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms chargeable units" + }, + "value": { + "text": "The number of text message fragments sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "email totals" + }, + "value": { + "text": "The number of emails sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter totals" + }, + "value": { + "text": "The number of letters sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter sheet totals" + }, + "value": { + "text": "The number of sheets sent" + } + } + ] + }) }} {% endblock %} diff --git a/app/templates/views/platform-admin/get-billing-report.html b/app/templates/views/platform-admin/get-billing-report.html index 41eace6f5a..866d9acd32 100644 --- a/app/templates/views/platform-admin/get-billing-report.html +++ b/app/templates/views/platform-admin/get-billing-report.html @@ -1,7 +1,7 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} {% from "components/page-footer.html" import page_footer %} -{% from "components/table.html" import mapping_table, row, text_field %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} Billing Report @@ -22,26 +22,56 @@

Data included in the report

-
- {% call mapping_table( - caption='Descriptions of billing report data', - field_headings=['Name', 'Description'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for column_heading, description in [ - ('sms cost', 'The total cost of text messages sent after a service has used its free allowance.'), - ('sms chargeable units', 'The number of fragments sent after a service has used its free allowance. This number takes into account the cost multiplier for sending international text messages.' | safe), - ('letter cost', 'The total cost of letters sent by a service.'), - ('letter breakdown', 'The number of letters sent by a service, grouped by postage and unit cost.'), - ('purchase order number, contact names, contact email addresses and billing reference', 'We add this data manually based on the information we get from services. You can help by adding it to the service settings page.'), - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ + {{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms cost" + }, + "value": { + "text": "The total cost of text messages sent after a service has used its free allowance." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms chargeable units" + }, + "value": { + "html": "The number of fragments sent after a service has used its free allowance. This number takes into account the cost multiplier for sending international text messages." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter cost" + }, + "value": { + "text": "The total cost of letters sent by a service." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter breakdown" + }, + "value": { + "text": "The number of letters sent by a service, grouped by postage and unit cost." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "purchase order number, contact names, contact email addresses and billing reference" + }, + "value": { + "text": "We add this data manually based on the information we get from services. You can help by adding it to the service settings page." + } + } + ] + }) }} {% endblock %} diff --git a/app/templates/views/platform-admin/get-dvla-billing-report.html b/app/templates/views/platform-admin/get-dvla-billing-report.html index 08fdc43f8a..f7975afcea 100644 --- a/app/templates/views/platform-admin/get-dvla-billing-report.html +++ b/app/templates/views/platform-admin/get-dvla-billing-report.html @@ -1,7 +1,7 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} {% from "components/page-footer.html" import page_footer %} -{% from "components/table.html" import mapping_table, row, text_field %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} DVLA Billing Report @@ -22,28 +22,74 @@

Data included in the report

-
- {% call mapping_table( - caption='Descriptions of billing report data', - field_headings=['Name', 'Description'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for column_heading, description in [ - ('despatch date', 'The date these letters were despatched by DVLA'), - ('postage', 'The postage of the letters (eg first, second, europe, rest-of-world)'), - ('DVLA cost threshold', 'A DVLA-internal pricing threshold (sorted, unsorted).'), - ('sheets', 'The number of sheets for each letter (1-5 pages)'), - ('rate (£)', 'The unit cost per letter in £ (GBP)'), - ('letters', 'The number of letters sent'), - ('cost (£)', 'The cost for sending these letters in £ (GBP)'), - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ + {{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "despatch date" + }, + "value": { + "text": "The date these letters were despatched by DVLA" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "postage" + }, + "value": { + "text": "The postage of the letters (eg first, second, europe, rest-of-world)" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "DVLA cost threshold" + }, + "value": { + "text": "A DVLA-internal pricing threshold (sorted, unsorted)." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sheets" + }, + "value": { + "text": "The number of sheets for each letter (1-5 pages)" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "rate (£)" + }, + "value": { + "text": "The unit cost per letter in £ (GBP)" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letters" + }, + "value": { + "text": "The number of letters sent" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "cost (£)" + }, + "value": { + "text": "The cost for sending these letters in £ (GBP)" + } + } + ] + }) }} {% endblock %} diff --git a/app/templates/views/platform-admin/users-list.html b/app/templates/views/platform-admin/users-list.html index 4c958cdf82..3b672aea34 100644 --- a/app/templates/views/platform-admin/users-list.html +++ b/app/templates/views/platform-admin/users-list.html @@ -1,8 +1,8 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} {% from "components/page-footer.html" import page_footer %} -{% from "components/table.html" import mapping_table, row, text_field %} {% from "govuk_frontend_jinja/components/details/macro.html" import govukDetails %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} Users List @@ -79,28 +79,77 @@

{% endcall %} -
- {% call mapping_table( - caption="Data included in the report", - field_headings=['Field', 'Description'], - field_headings_visible=True, - caption_visible=True - ) %} - {% for column_heading, description in [ - ('Name', 'The full name of the user'), - ('Email', 'The email address associated with the user'), - ('Created At', 'The date the user account was created'), - ('Research Opt In', 'Whether the user has opted in to research'), - ('Is Org Team Member', 'Indicates if the user is a member of an organisation'), - ('Number of Live Services', 'The number of live services the user has access to'), - ('Live Service Permissions', 'The services and associated permissions assigned to the user'), - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+

+ Data included in the report +

+ +{{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "Name" + }, + "value": { + "text": "The full name of the user" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Email" + }, + "value": { + "text": "The email address associated with the user" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Created At" + }, + "value": { + "text": "The date the user account was created" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Research Opt In" + }, + "value": { + "text": "Whether the user has opted in to research" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Is Org Team Member" + }, + "value": { + "text": "Indicates if the user is a member of an organisation" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Number of Live Services" + }, + "value": { + "text": "The number of live services the user has access to" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "Live Service Permissions" + }, + "value": { + "text": "The services and associated permissions assigned to the user" + } + } + ] +}) }} {% endblock %} diff --git a/app/templates/views/platform-admin/volumes-by-service-report.html b/app/templates/views/platform-admin/volumes-by-service-report.html index 8f97ce532b..0dbfa219ec 100644 --- a/app/templates/views/platform-admin/volumes-by-service-report.html +++ b/app/templates/views/platform-admin/volumes-by-service-report.html @@ -1,7 +1,7 @@ {% extends "views/platform-admin/_base_template.html" %} {% from "components/form.html" import form_wrapper %} -{% from "components/table.html" import mapping_table, row, text_field %} {% from "components/page-footer.html" import page_footer %} +{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %} {% block per_page_title %} Volumes by service report @@ -22,28 +22,74 @@

Data included in the report

-
- {% call mapping_table( - caption='Descriptions of volumes by service data', - field_headings=['Name', 'Description'], - field_headings_visible=True, - caption_visible=False - ) %} - {% for column_heading, description in [ - ('free allowance', 'Free allowance set for the service. This is the latest free allowance for the date range given'), - ('sms notifications', 'The number of text messages sent by the service.'), - ('sms chargeable units', 'The number of text message fragments times the rate multiplier sent by the service.'), - ('email totals', 'The number of emails sent by a service'), - ('letter totals', 'The number of letters sent by a service'), - ('letter costs', 'The cost of the letters, rate * letter totals'), - ('letter sheet totals', 'The number of sheet sent by a service') - ] %} - {% call row() %} - {{ text_field(column_heading) }} - {{ text_field(description) }} - {% endcall %} - {% endfor %} - {% endcall %} -
+ + {{ govukSummaryList({ + "classes": "notify-summary-list govuk-!-margin-bottom-7 govuk-!-font-size-16", + "rows": [ + { + "key": { + "classes": "notify-summary-list__key", + "text": "free allowance" + }, + "value": { + "text": "Free allowance set for the service. This is the latest free allowance for the date range given" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms notifications" + }, + "value": { + "text": "The number of text messages sent by the service." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "sms chargeable units" + }, + "value": { + "text": "The number of text message fragments times the rate multiplier sent by the service." + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "email totals" + }, + "value": { + "text": "The number of emails sent by a service" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter totals" + }, + "value": { + "text": "The number of letters sent by a service" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter costs" + }, + "value": { + "text": "The cost of the letters, rate * letter totals" + } + }, + { + "key": { + "classes": "notify-summary-list__key", + "text": "letter sheet totals" + }, + "value": { + "text": "The number of sheet sent by a service" + } + } + ] + }) }} {% endblock %} From 3deb14e99f00223e6611369e08b2d3bc3ee3d0a8 Mon Sep 17 00:00:00 2001 From: Jani Kraner Date: Mon, 6 Jul 2026 14:35:11 +0100 Subject: [PATCH 2/2] Remove platform-admin/services page Functionality gone in https://github.com/alphagov/notifications-admin/pull/5228 so page can be removed. --- .../views/platform-admin/services.html | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 app/templates/views/platform-admin/services.html diff --git a/app/templates/views/platform-admin/services.html b/app/templates/views/platform-admin/services.html deleted file mode 100644 index bd752b2b32..0000000000 --- a/app/templates/views/platform-admin/services.html +++ /dev/null @@ -1,85 +0,0 @@ -{% extends "views/platform-admin/_base_template.html" %} -{% from "components/big-number.html" import big_number %} -{% from "components/table.html" import mapping_table, field, row_group, row, right_aligned_field_heading %} -{% from "components/form.html" import form_wrapper %} -{% from "govuk_frontend_jinja/components/button/macro.html" import govukButton %} -{% from "govuk_frontend_jinja/components/details/macro.html" 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, - output_tbody_tags=False, - ) %} - - {% for service in services %} - - {% call row_group() %} - - {% call row() %} - {% call field(border=False, colspan=3) %} - {{ service['name'] }} - {% if not service['active'] %} -  Archived - {% endif %} - {% endcall %} - - {% endcall %} - - {% call row() %} - {% for channel in ('email', 'sms', 'letter') %} - {% call field(border=False) %} - {{ big_number( - service['stats'][channel]['requested'], - smallest=True, - label=service['stats'][channel]['requested']|message_count_label(channel) - ) }} - {% endcall %} - {% endfor %} - {% endcall %} - - {% endcall %} - - {% endfor %} - - {% endcall %} -{% endmacro %} - - -{% block per_page_title %} - {{ page_title|capitalize }} -{% endblock %} - -{% block platform_admin_content %} - -

- {{ page_title|capitalize }} -

- - - {% set details_content %} - {% call form_wrapper(method="get") %} - {{ form.start_date(param_extensions={"hint": {"text": "Enter start date in format YYYY-MM-DD"}}) }} - {{ form.end_date(param_extensions={"hint": {"text": "Enter end date in format YYYY-MM-DD"}}) }} - {{ form.include_from_test_key }} - {{ govukButton({ "text": "Filter" }) }} - {% endcall %} - {% endset %} - - {{ govukDetails({ - "summaryText": "Apply filters", - "html": details_content, - "open": form.errors | convert_to_boolean - }) }} - - {% include "views/platform-admin/_global_stats.html" %} - - {{ services_table(services, page_title|capitalize) }} - -{% endblock %}