diff --git a/app/templates/partials/check/message-too-long.html b/app/templates/partials/check/message-too-long.html new file mode 100644 index 000000000..5dde66856 --- /dev/null +++ b/app/templates/partials/check/message-too-long.html @@ -0,0 +1,10 @@ +
+ {% call banner_wrapper(type='dangerous') %} +

+ Message too long +

+

+ Text messages can’t be longer than {{ template|string|length }} characters. Your message is {{message_length}} characters. +

+ {% endcall %} +
diff --git a/app/templates/partials/check/not-allowed-to-send-to.html b/app/templates/partials/check/not-allowed-to-send-to.html new file mode 100644 index 000000000..932bbbb4c --- /dev/null +++ b/app/templates/partials/check/not-allowed-to-send-to.html @@ -0,0 +1,17 @@ +
+ {% call banner_wrapper(type='dangerous') %} +

+ You can’t send to + {{ 'this' if count_of_recipients == 1 else 'these' }} + {{ recipients.recipient_column_headers[0] }} + {%- if count_of_recipients != 1 -%} + {{ 'es' if 'email address' == recipients.recipient_column_headers[0] else 's' }} + {%- endif %} +

+

+ In trial mode you can only + send to yourself and members of your team +

+ {{ skip_to_file_contents() }} + {% endcall %} +
diff --git a/app/templates/partials/check/too-many-messages.html b/app/templates/partials/check/too-many-messages.html index 761ca0801..c81a0e75b 100644 --- a/app/templates/partials/check/too-many-messages.html +++ b/app/templates/partials/check/too-many-messages.html @@ -1,7 +1,11 @@
{% call banner_wrapper(type='dangerous') %}

- Too many recipients + {% if original_file_name %} + Too many recipients + {% else %} + Daily limit reached + {% endif %}

You can only send {{ current_service.message_limit }} messages per day @@ -10,29 +14,31 @@ {%- endif -%} .

-

- {% if current_service.message_limit != remaining_messages %} - You can still send {{ remaining_messages }} messages today, but - {% endif %} - ‘{{ original_file_name }}’ contains - {{ count_of_recipients }} - {% if count_of_recipients == 1 -%} - {%- if template.template_type == 'email' -%} - email address - {%- elif template.template_type == 'sms' -%} - phone number - {%- elif template.template_type == 'letter' -%} - address - {%- endif -%} - {%- else -%} - {%- if template.template_type == 'email' -%} - email addresses - {%- elif template.template_type == 'sms' -%} - phone numbers - {%- elif template.template_type == 'letter' -%} - addresses - {%- endif -%} - {%- endif -%}. -

+ {% if original_file_name %} +

+ {% if current_service.message_limit != remaining_messages %} + You can still send {{ remaining_messages }} messages today, but + {% endif %} + ‘{{ original_file_name }}’ contains + {{ count_of_recipients }} + {% if count_of_recipients == 1 -%} + {%- if template.template_type == 'email' -%} + email address + {%- elif template.template_type == 'sms' -%} + phone number + {%- elif template.template_type == 'letter' -%} + address + {%- endif -%} + {%- else -%} + {%- if template.template_type == 'email' -%} + email addresses + {%- elif template.template_type == 'sms' -%} + phone numbers + {%- elif template.template_type == 'letter' -%} + addresses + {%- endif -%} + {%- endif -%}. +

+ {% endif %} {% endcall %}
diff --git a/app/templates/views/check.html b/app/templates/views/check.html index d7819fca2..67048a016 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -120,25 +120,7 @@ {% elif not recipients.allowed_to_send_to %} - -
- {% call banner_wrapper(type='dangerous') %} -

- You can’t send to - {{ 'this' if count_of_recipients == 1 else 'these' }} - {{ recipients.recipient_column_headers[0] }} - {%- if count_of_recipients != 1 -%} - {{ 'es' if 'email address' == recipients.recipient_column_headers[0] else 's' }} - {%- endif %} -

-

- In trial mode you can only - send to yourself and members of your team -

- {{ skip_to_file_contents() }} - {% endcall %} -
- + {% include "partials/check/not-allowed-to-send-to.html" %} {% elif recipients.more_rows_than_can_send %} {% include "partials/check/too-many-messages.html" %} {% else %}