From 20eb08a12220e10b954a991db19cdf942f16fff0 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 21 Jul 2016 13:47:18 +0100 Subject: [PATCH] move too many messages error to its own partial --- .../partials/check/too_many_messages.html | 27 +++++++++++++++++ app/templates/views/check.html | 30 +------------------ 2 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 app/templates/partials/check/too_many_messages.html 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 %}