Allow users to preview all letters in trial mode

If you’re in trial mode you can’t send letters for real. But you can
still upload a spreadsheet with multiple rows, and there’s no reason why
you shouldn’t be able to explore how Notify populate the letter for each
row of the spreadsheet (since this is something we let you do when you
can send the messages for real).
This commit is contained in:
Chris Hill-Scott
2018-05-21 10:06:16 +01:00
parent 8ce0c175e8
commit e74d408953
2 changed files with 18 additions and 3 deletions

View File

@@ -162,7 +162,16 @@
) %}
{% call index_field() %}
<span>
{{ item.index + 2 }}
{% set displayed_index = item.index + 2 %}
{% if (
trying_to_send_letters_in_trial_mode and
(not errors or recipients.more_rows_than_can_send) and
displayed_index != preview_row
) %}
<a href="{{ url_for('.check_messages', service_id=current_service.id, template_id=template.id, upload_id=upload_id, row_index=displayed_index) }}">{{ displayed_index }}</a>
{% else %}
{{ displayed_index }}
{% endif %}
</span>
{% endcall %}
{% for column in column_headers %}