add template partials for some notification checks

also move out some from the check.html page. This is going to help
with sharing templates between single notifications and csv files.
This commit is contained in:
Leo Hemsted
2017-06-29 12:23:42 +01:00
parent 4eb35a9aa6
commit f1ecee8469
4 changed files with 59 additions and 44 deletions

View File

@@ -0,0 +1,10 @@
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
<h1 class='banner-title'>
Message too long
</h1>
<p>
Text messages cant be longer than {{ template|string|length }} characters. Your message is {{message_length}} characters.
</p>
{% endcall %}
</div>

View File

@@ -0,0 +1,17 @@
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
<h1 class='banner-title'>
You cant 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 %}
</h1>
<p>
In <a href="{{ url_for('.trial_mode') }}">trial mode</a> you can only
send to yourself and members of your team
</p>
{{ skip_to_file_contents() }}
{% endcall %}
</div>

View File

@@ -1,7 +1,11 @@
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
<h1 class='banner-title'>
Too many recipients
{% if original_file_name %}
Too many recipients
{% else %}
Daily limit reached
{% endif %}
</h1>
<p>
You can only send {{ current_service.message_limit }} messages per day
@@ -10,29 +14,31 @@
{%- endif -%}
.
</p>
<p>
{% 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 -%}.
</p>
{% if original_file_name %}
<p>
{% 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 -%}.
</p>
{% endif %}
{% endcall %}
</div>

View File

@@ -120,25 +120,7 @@
</div>
{% elif not recipients.allowed_to_send_to %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
<h1 class='banner-title'>
You cant 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 %}
</h1>
<p>
In <a href="{{ url_for('.trial_mode') }}">trial mode</a> you can only
send to yourself and members of your team
</p>
{{ skip_to_file_contents() }}
{% endcall %}
</div>
{% include "partials/check/not-allowed-to-send-to.html" %}
{% elif recipients.more_rows_than_can_send %}
{% include "partials/check/too-many-messages.html" %}
{% else %}