Files
notifications-admin/app/templates/views/send-test.html

48 lines
1.5 KiB
HTML
Raw Normal View History

{% extends "withnav_template.html" %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/message-count-label.html" import recipient_count_label %}
Show one field at a time on send yourself a test The send yourself a test feature is useful for two things: - constructing an email/text message/letter without uploading a CSV file - seeing what the thing your going to send will look like (either by getting it in your inbox or downloading the PDF) - learning the concept of placeholders, ie understanding they’re thing that gets populated with _stuff_ The problem we’re seeing is that the current UI breaks when a template has a lot of placeholders. This is especially apparent with letter templates, which have a minimum of 7 placeholders by virtue of the address. The idea behind having the form fields side-by-side was to help people understand the relationship between their spreadsheet columns and the placeholders. But this means that the page was doing a lot of work, trying to teach: - replacement of placeholders - link between placeholders and spreadsheet columns The latter is better explained by the example spreadsheet shown on the upload page. So it can safely be removed from the send yourself a test page – in other words the fields don’t need to be shown side by side. Showing them one-at-a-time works well because: - it’s really obvious, even on first use, what the page is asking you to do - as your step through each placeholder, you see the message build up with the data you’ve entered – you’re learning how replacement of placeholders works by repetition This also means adding a matching endpoint for viewing each step of making the test letter as a PDF/PNG because we can’t reuse the view of the template without any placeholders filled any more.
2017-05-04 09:30:55 +01:00
{% from "components/textbox.html" import textbox %}
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
{{ page_title }}
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{{ page_title }}
</h1>
{% call form_wrapper(
class='js-stick-at-top-when-scrolling send-one-off-form' if template.template_type != 'sms' else 'send-one-off-form',
module="autofocus"
) %}
<div class="grid-row">
<div class="column-two-thirds {% if form.placeholder_value.label.text == 'phone number' %}extra-tracking{% endif %}">
{{ textbox(
form.placeholder_value,
hint='Optional' if optional_placeholder else None,
width='1-1',
) }}
</div>
{% if skip_link %}
<div class="column-one-third">
<a href="{{ skip_link[1] }}" class="top-gutter-4-3">{{ skip_link[0] }}</a>
</div>
{% endif %}
</div>
{% if link_to_upload %}
<p>
<a href="{{ url_for('.send_messages', service_id=current_service.id, template_id=template.id) }}">
Upload a list of {{ recipient_count_label(999, template.template_type) }}
</a>
</p>
{% endif %}
{{ page_footer('Continue', back_link=back_link) }}
{% endcall %}
{{ template|string }}
{% endblock %}