Use real templates when sending text messages

Sets the value of `template` to the ID of the chosen template when submitting
the form.
This commit is contained in:
Chris Hill-Scott
2016-01-26 16:57:02 +00:00
parent 1c9b71a750
commit 3a864ad132
5 changed files with 39 additions and 25 deletions

View File

@@ -14,7 +14,7 @@
</h3>
{% endif %}
{% if input_name %}
<input class="sms-message-picker" type="radio" id="{{ input_name }}-{{ input_index }}" name="{{ input_name }}" />
<input class="sms-message-picker" type="radio" id="{{ input_name }}-{{ input_index }}" name="{{ input_name }}" value="{{ input_index }}" />
{% endif %}
<div class="sms-message-wrapper{% if input_name %}-with-radio{% endif %}">
{{ body|placeholders }}

View File

@@ -17,9 +17,9 @@
<fieldset class='form-group'>
<legend class="heading-medium">1. Choose text message template</legend>
{% for template in message_templates %}
{% for template in templates %}
{{ sms_message(
template.body, name=template.name, input_name='template', input_index=loop.index
template.content, name=template.name, input_name='template', input_index=template.id
) }}
{% endfor %}
</fieldset>