mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05: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,
|
||||
TextAreaField,
|
||||
FileField,
|
||||
SelectField
|
||||
RadioField
|
||||
)
|
||||
from wtforms.validators import DataRequired, Email, Length, Regexp
|
||||
|
||||
@@ -193,7 +193,8 @@ class TemplateForm(Form):
|
||||
name = StringField(
|
||||
u'Template name',
|
||||
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(
|
||||
u'Message',
|
||||
validators=[DataRequired(message="Template content cannot be empty")])
|
||||
|
||||
@@ -12,7 +12,15 @@ GOV.UK Notify | Edit template
|
||||
|
||||
<form method="post">
|
||||
{{ 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) }}
|
||||
{{ page_footer(
|
||||
'Save',
|
||||
|
||||
Reference in New Issue
Block a user