Don’t allow user to send texts without template

This commit is contained in:
Chris Hill-Scott
2016-02-03 13:38:55 +00:00
parent 8d3e3e6943
commit c774b82ba9

View File

@@ -12,15 +12,23 @@
<h1 class="heading-large">Send text messages</h1>
<fieldset class='form-group'>
{% for template in templates %}
{{ sms_message(
template.content, name=template.name, input_name='template', input_index=template.id
) }}
{% endfor %}
</fieldset>
{{ page_footer("Continue") }}
{% if templates %}
<fieldset class='form-group'>
{% for template in templates %}
{{ sms_message(
template.content, name=template.name, input_name='template', input_index=template.id
) }}
{% endfor %}
</fieldset>
{{ page_footer("Continue") }}
{% else %}
{{ banner(
'<a href="{}">Add a text message template</a> to start sending messages'.format(
url_for(".add_service_template", service_id=service_id)
)|safe,
type="tip"
)}}
{% endif %}
</form>
{% endblock %}