Add a message count component

The logic to say ‘1 email sent’ vs ‘12 text messages sent’ is repeated
all over the place. So this commit adds a component to put it in one
place.
This commit is contained in:
Chris Hill-Scott
2016-05-13 09:58:07 +01:00
parent 3dc349c8a7
commit 8a4b0ba88c
4 changed files with 24 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
{% macro message_count_label(count, template_type) -%}
{%- if template_type == 'sms' -%}
{%- if count == 1 -%}
text message
{%- else -%}
text messages
{%- endif -%}
{%- elif template_type == 'email' -%}
{%- if count == 1 -%}
email
{%- else -%}
emails
{%- endif -%}
{%- endif %} sent
{%- endmacro %}