mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Make ‘template type’ radio buttons not <select>
Because burn your select tags[1] This commit hard codes the markup for the time being until I can work out how to get WTForms outputting the markup I want. 1. https://www.youtube.com/watch?v=CUkMCQR4TpY
This commit is contained in:
@@ -7,7 +7,7 @@ from wtforms import (
|
|||||||
ValidationError,
|
ValidationError,
|
||||||
TextAreaField,
|
TextAreaField,
|
||||||
FileField,
|
FileField,
|
||||||
SelectField
|
RadioField
|
||||||
)
|
)
|
||||||
from wtforms.validators import DataRequired, Email, Length, Regexp
|
from wtforms.validators import DataRequired, Email, Length, Regexp
|
||||||
|
|
||||||
@@ -193,7 +193,8 @@ class TemplateForm(Form):
|
|||||||
name = StringField(
|
name = StringField(
|
||||||
u'Template name',
|
u'Template name',
|
||||||
validators=[DataRequired(message="Template name cannot be empty")])
|
validators=[DataRequired(message="Template name cannot be empty")])
|
||||||
template_type = SelectField(u'Template type', choices=[('sms', 'SMS')])
|
template_type = RadioField(u'Template type', choices=[('sms', 'SMS')])
|
||||||
|
|
||||||
template_content = TextAreaField(
|
template_content = TextAreaField(
|
||||||
u'Message',
|
u'Message',
|
||||||
validators=[DataRequired(message="Template content cannot be empty")])
|
validators=[DataRequired(message="Template content cannot be empty")])
|
||||||
|
|||||||
@@ -12,7 +12,15 @@ GOV.UK Notify | Edit template
|
|||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{{ textbox(form.name) }}
|
{{ textbox(form.name) }}
|
||||||
{{ textbox(form.template_type) }}
|
<fieldset class="form-group">
|
||||||
|
<legend class="form-label">
|
||||||
|
Template type
|
||||||
|
</legend>
|
||||||
|
<label class="block-label" for="template_type">
|
||||||
|
<input type="radio" name="template_type" id="template_type" checked="checked" value="sms" />
|
||||||
|
SMS
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
{{ textbox(form.template_content, highlight_tags=True) }}
|
{{ textbox(form.template_content, highlight_tags=True) }}
|
||||||
{{ page_footer(
|
{{ page_footer(
|
||||||
'Save',
|
'Save',
|
||||||
|
|||||||
Reference in New Issue
Block a user