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:
Chris Hill-Scott
2016-01-22 12:19:15 +00:00
parent 9ee8610da0
commit cd38d54be7
2 changed files with 12 additions and 3 deletions

View File

@@ -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")])