Files
notifications-admin/app/templates/components/message-count-label.html
Chris Hill-Scott 154d4bdb85 Allow adding broadcast templates
At the moment the page is the same as for text message templates,
except:
- different H1
- no guidance about personalisation, links, etc (until we decide how
  these should work)

For now you won’t be able to really create a broadcast template, because
the API doesn’t support it (the API will respond with a 400). But that’s
OK because no real services have the broadcast permission yet.

This required a bit of refactoring of how we check which template types
a service can use, because there were some hard-coded assumptions about
emails and text messages.
2020-07-01 17:17:46 +01:00

64 lines
1.4 KiB
HTML

{% macro message_count_label(count, template_type, suffix='sent') -%}
{% if template_type == None %}
{%- if count == 1 -%}
message
{%- else -%}
messages
{%- endif -%}
{% endif %}
{%- if template_type == 'sms' -%}
{%- if count == 1 -%}
text message
{%- else -%}
text messages
{%- endif -%}
{%- elif template_type == 'email' -%}
{%- if count == 1 -%}
email
{%- else -%}
emails
{%- endif -%}
{%- elif template_type == 'letter' -%}
{%- if count == 1 -%}
letter
{%- else -%}
letters
{%- endif -%}
{%- elif template_type == 'broadcast' -%}
{%- if count == 1 -%}
broadcast
{%- else -%}
broadcasts
{%- endif -%}
{%- endif %} {{ suffix }}
{%- endmacro %}
{% macro recipient_count_label(count, template_type) -%}
{% if template_type == None %}
{%- if count == 1 -%}
recipient
{%- else -%}
recipients
{%- endif -%}
{% endif %}
{%- if template_type == 'sms' -%}
{%- if count == 1 -%}
phone number
{%- else -%}
phone numbers
{%- endif -%}
{%- elif template_type == 'email' -%}
{%- if count == 1 -%}
email address
{%- else -%}
email addresses
{%- endif -%}
{%- elif template_type == 'letter' -%}
{%- if count == 1 -%}
address
{%- else -%}
addresses
{%- endif -%}
{%- endif %}
{%- endmacro %}