diff --git a/app/templates/partials/check/too_many_messages.html b/app/templates/partials/check/too_many_messages.html new file mode 100644 index 000000000..66ba82f06 --- /dev/null +++ b/app/templates/partials/check/too_many_messages.html @@ -0,0 +1,27 @@ +
+ {% call banner_wrapper(type='dangerous') %} +

+ Too many recipients +

+ {% if statistics.emails_requested or statistics.sms_requested %} +

+ You can only send {{ current_service.message_limit }} + messages per day + {%- if current_service.restricted %} + in trial mode + {%- endif -%} + . +

+ {% endif %} +

+ You can still send + {{ current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0) }} + messages today, but + ‘{{ original_file_name }}’ contains + {{ count_of_recipients }} {{ recipients.recipient_column_header }} + {%- if count_of_recipients != 1 -%} + {{ 'es' if 'email address' == recipients.recipient_column_header else 's' }} + {%- endif %} +

+ {% endcall %} +
diff --git a/app/templates/views/check.html b/app/templates/views/check.html index 5c5c4db5b..8fe0d01f7 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -104,35 +104,7 @@ {% elif count_of_recipients > (current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0)) %} - -
- {% call banner_wrapper(type='dangerous') %} -

- Too many recipients -

- {% if statistics.emails_requested or statistics.sms_requested %} -

- You can only send {{ current_service.message_limit }} - messages per day - {%- if current_service.restricted %} - in trial mode - {%- endif -%} - . -

- {% endif %} -

- You can still send - {{ current_service.message_limit - statistics.get('emails_requested', 0) - statistics.get('sms_requested', 0) }} - messages today, but - ‘{{ original_file_name }}’ contains - {{ count_of_recipients }} {{ recipients.recipient_column_header }} - {%- if count_of_recipients != 1 -%} - {{ 'es' if 'email address' == recipients.recipient_column_header else 's' }} - {%- endif %} -

- {% endcall %} -
- + {% include "partials/check/too_many_messages.html" %} {% else %}