Use message_count_label component

For the button on the check page, we need to be able to say ‘1 text message’ or
‘55 emails’. We already have the logic to do this on the dashboard (101 text
messages sent), and it’s already in a component. So this commit makes the check
page use the same component.
This commit is contained in:
Chris Hill-Scott
2016-06-03 14:48:21 +01:00
parent 9332f57f55
commit 4ac1a03a89
3 changed files with 6 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
{% macro message_count_label(count, template_type) -%}
{% macro message_count_label(count, template_type, suffix='sent') -%}
{%- if template_type == 'sms' -%}
{%- if count == 1 -%}
text message
@@ -10,6 +10,6 @@
email
{%- else -%}
emails
{%- endif -%}
{%- endif %} sent
{%- endmacro %}
{%- endif -%}
{%- endif %} {{ suffix }}
{%- endmacro %}