mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 06:18:24 -04:00
Replace message count macros with formatters
We prefer formatters now. Removing uses of the aliasing macro lets remove it entirely.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
<div class="ajax-block">
|
||||
{% if current_service.inbound_sms_summary != None %}
|
||||
<a id="total-received" class="govuk-link govuk-link--no-visited-state banner-dashboard" class="banner-dashboard" href="{{ url_for('.inbox', service_id=current_service.id) }}">
|
||||
@@ -7,7 +5,7 @@
|
||||
{{ current_service.inbound_sms_summary.count|format_thousands }}
|
||||
</span>
|
||||
<span class="banner-dashboard-count-label">
|
||||
{{ message_count_label(current_service.inbound_sms_summary.count, 'sms', suffix='received') }}
|
||||
{{ current_service.inbound_sms_summary.count|message_count_label('sms', suffix='received') }}
|
||||
</span>
|
||||
{% if current_service.inbound_sms_summary.most_recent %}
|
||||
<span class="banner-dashboard-meta">
|
||||
@@ -22,7 +20,7 @@
|
||||
{{ current_service.count_of_returned_letters_in_last_7_days|format_thousands }}
|
||||
</span>
|
||||
<span class="banner-dashboard-count-label">
|
||||
returned {{ message_count_label(current_service.count_of_returned_letters_in_last_7_days, 'letter', suffix='') }}
|
||||
returned {{ current_service.count_of_returned_letters_in_last_7_days|message_count_label('letter', suffix='') }}
|
||||
</span>
|
||||
<span class="banner-dashboard-meta">
|
||||
latest report {{ current_service.date_of_most_recent_returned_letter_report|format_delta_days }}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{% from "components/table.html" import list_table, field, hidden_field_heading, right_aligned_field_heading, row_heading %}
|
||||
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
<div class="ajax-block-container">
|
||||
{% if messages %}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading %}
|
||||
{% from "components/big-number.html" import big_number -%}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
<div class='dashboard-table ajax-block-container'>
|
||||
{% call(item, row_number) list_table(
|
||||
@@ -66,8 +65,7 @@
|
||||
{{ big_number(
|
||||
item.notification_count,
|
||||
smallest=True,
|
||||
label=message_count_label(
|
||||
item.notification_count,
|
||||
label=item.notification_count|message_count_label(
|
||||
item.template_type,
|
||||
suffix='waiting to send'
|
||||
)
|
||||
@@ -76,8 +74,7 @@
|
||||
{{ big_number(
|
||||
item.notification_count,
|
||||
smallest=True,
|
||||
label=message_count_label(
|
||||
item.notification_count,
|
||||
label=item.notification_count|message_count_label(
|
||||
item.template_type,
|
||||
suffix=''
|
||||
)
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
{% from "components/big-number.html" import big_number_with_status %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
<div class="ajax-block-container">
|
||||
<div class="govuk-grid-row">
|
||||
<div id="total-email" class="govuk-grid-column-one-third">
|
||||
{{ big_number_with_status(
|
||||
statistics['email']['requested'],
|
||||
message_count_label(statistics['email']['requested'], 'email', suffix='sent'),
|
||||
statistics['email']['requested']|message_count_label('email', suffix='sent'),
|
||||
statistics['email']['failed'],
|
||||
statistics['email']['failed_percentage'],
|
||||
statistics['email']['show_warning'],
|
||||
@@ -18,7 +17,7 @@
|
||||
<div id="total-sms" class="govuk-grid-column-one-third">
|
||||
{{ big_number_with_status(
|
||||
statistics['sms']['requested'],
|
||||
message_count_label(statistics['sms']['requested'], 'sms', suffix='sent'),
|
||||
statistics['sms']['requested']|message_count_label('sms', suffix='sent'),
|
||||
statistics['sms']['failed'],
|
||||
statistics['sms']['failed_percentage'],
|
||||
statistics['sms']['show_warning'],
|
||||
@@ -30,7 +29,7 @@
|
||||
<div id="total-letters" class="govuk-grid-column-one-third">
|
||||
{{ big_number_with_status(
|
||||
statistics['letter']['requested'],
|
||||
message_count_label(statistics['letter']['requested'], 'letter', suffix='sent'),
|
||||
statistics['letter']['requested']|message_count_label('letter', suffix='sent'),
|
||||
statistics['letter']['failed'],
|
||||
statistics['letter']['failed_percentage'],
|
||||
statistics['letter']['show_warning'],
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
{% from "components/pill.html" import pill %}
|
||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading, spark_bar_field %}
|
||||
|
||||
@@ -44,7 +43,7 @@
|
||||
{% call row_heading() %}
|
||||
<a class="govuk-link govuk-link--no-visited-state template-statistics-table-template-name" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}">{{ item.name }}</a>
|
||||
<span class="template-statistics-table-hint">
|
||||
{{ message_count_label(1, item.type, suffix='template')|capitalize }}
|
||||
{{ 1|message_count_label(item.type, suffix='template')|capitalize }}
|
||||
</span>
|
||||
{% endcall %}
|
||||
{{ spark_bar_field(item.requested_count, most_used_template_count) }}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
{% from "components/show-more.html" import show_more %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, hidden_field_heading %}
|
||||
{% from "components/ajax-block.html" import ajax_block %}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{% from "components/big-number.html" import big_number_with_status, big_number %}
|
||||
{% from "components/pill.html" import pill %}
|
||||
{% from "components/table.html" import list_table, field, hidden_field_heading, right_aligned_field_heading, row_heading %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
|
||||
{% extends "withnav_template.html" %}
|
||||
|
||||
@@ -49,7 +48,7 @@
|
||||
{% call field(align='left') %}
|
||||
{{ big_number(
|
||||
counts.requested,
|
||||
message_count_label(counts.requested, template_type, suffix=''),
|
||||
counts.requested|message_count_label(template_type, suffix=''),
|
||||
smallest=True,
|
||||
) }}
|
||||
{% if counts.requested %}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{% from "components/big-number.html" import big_number %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
{% from "components/big-number.html" import big_number %}
|
||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading, spark_bar_field %}
|
||||
{% from "components/show-more.html" import show_more %}
|
||||
@@ -30,7 +29,7 @@
|
||||
{% else %}
|
||||
<a class="govuk-link govuk-link--no-visited-state template-statistics-table-template-name" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template_id) }}">{{ item.template_name }}</a>
|
||||
<span class="template-statistics-table-hint">
|
||||
{{ message_count_label(1, item.template_type, suffix='template')|capitalize }}
|
||||
{{ 1|message_count_label(item.template_type, suffix='template')|capitalize }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user