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:
Chris Hill-Scott
2021-01-06 13:41:16 +00:00
parent 0327ece7ad
commit 24b579418f
34 changed files with 36 additions and 77 deletions

View File

@@ -1,4 +1,3 @@
{% from 'components/message-count-label.html' import message_count_label %}
{% from "components/banner.html" import banner_wrapper %}
<div class="govuk-grid-column-full">
@@ -9,7 +8,7 @@
{% elif not current_user.has_permissions('send_messages', 'manage_api_keys', 'manage_templates', 'manage_service') or not user_has_template_permission %}
<p class="top-gutter-1-3 {% if template.template_type != 'sms' %}bottom-gutter{% endif %}">
If you need to send this
{{ message_count_label(1, template.template_type, suffix='') }}
{{ 1|message_count_label(template.template_type, suffix='') }}
or edit this template, contact your manager.
</p>
{% else %}

View File

@@ -1,5 +1,3 @@
{% from "components/message-count-label.html" import folder_contents_count, message_count_label %}
{% macro format_item_name(name, separators=True) -%}
{%- if name is string -%}
{{- name -}}
@@ -19,7 +17,7 @@
{% if template_list.folder_is_empty %}
This folder is empty
{% else %}
There are no {{ message_count_label(1, template_type, suffix='') }} templates in this folder
There are no {{ 1|message_count_label(template_type, suffix='') }} templates in this folder
{% endif %}
</p>
{% else %}

View File

@@ -1,7 +1,6 @@
{% extends "withnav_template.html" %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/message-count-label.html" import message_count_label %}
{% block service_page_title %}
{{ notification_type.capitalize() }} are disabled
@@ -16,10 +15,10 @@
back_link=back_link,
) }}
<p class="govuk-body">
Sending {{ message_count_label(999, notification_type, suffix='') -}} has been disabled for your service.
Sending {{ 999|message_count_label(notification_type, suffix='') }} has been disabled for your service.
</p>
<p class="govuk-body">
If you need to send {{ message_count_label(999, notification_type, suffix='') }}
If you need to send {{ 999|message_count_label(notification_type, suffix='') }}
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.support') }}">get in touch with the GOV.UK Notify team</a>.
</p>

View File

@@ -1,6 +1,5 @@
{% from "components/folder-path.html" import folder_path, page_title_folder_path %}
{% from "components/pill.html" import pill %}
{% from "components/message-count-label.html" import message_count_label %}
{% from "components/live-search.html" import live_search %}
{% from "components/form.html" import form_wrapper %}
{% from "components/page-header.html" import page_header %}