Show error banner for one off letter in trial mode

In trial mode you can’t send letters. But it’s still useful to be able
to build up a letter to see how it work.

Best place to put this error is before someone tries to send a letter
for real.
This commit is contained in:
Chris Hill-Scott
2018-10-30 16:32:10 +00:00
parent a79dfd1d6e
commit 1675e6c8d2
4 changed files with 81 additions and 11 deletions

View File

@@ -0,0 +1,8 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Trying to send letters in trial mode" data-error-label="{{ upload_id }}">
You cant send
{{ 'this letter' if count_of_recipients == 1 else 'these letters' }}
</h1>
<p>
In <a href="{{ url_for('.using_notify') }}#trial-mode">trial mode</a> you
can only preview how your letters will look
</p>

View File

@@ -109,14 +109,15 @@
{% elif trying_to_send_letters_in_trial_mode %}
<h1 class='banner-title' data-module="track-error" data-error-type="Trying to send letters in trial mode" data-error-label="{{ upload_id }}">
You cant send
{{ 'this letter' if count_of_recipients == 1 else 'these letters' }}
</h1>
<p>
In <a href="{{ url_for('.using_notify') }}#trial-mode">trial mode</a> you
can only preview how your letters will look
</p>
<div class="bottom-gutter">
{% with
count_of_recipients=count_of_recipients
%}
{% call banner_wrapper(type='dangerous') %}
{% include "partials/check/trying-to-send-letters-in-trial-mode.html" %}
{% endcall %}
{% endwith %}
</div>
{% elif recipients.more_rows_than_can_send %}

View File

@@ -7,7 +7,18 @@
{% endblock %}
{% block maincolumn_content %}
{% if error == 'not-allowed-to-send-to' %}
{% if template.template_type == 'letter' and current_service.trial_mode %}
{% set error = 'trial-mode-letters' %}
<div class="bottom-gutter">
{% with
count_of_recipients=1
%}
{% call banner_wrapper(type='dangerous') %}
{% include "partials/check/trying-to-send-letters-in-trial-mode.html" %}
{% endcall %}
{% endwith %}
</div>
{% elif error == 'not-allowed-to-send-to' %}
<div class="bottom-gutter">
{% call banner_wrapper(type='dangerous') %}
{% with