mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 15:28:50 -04:00
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:
15
app/templates/components/message-count-label.html
Normal file
15
app/templates/components/message-count-label.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user