From b372ab7ba18ab312f44da889167063638052c086 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Thu, 19 Jan 2017 09:35:34 +0000 Subject: [PATCH] Change the selectField on the edit template form to a radio field. It's more stylish --- app/main/forms.py | 16 +++++++++++++--- app/templates/views/edit-email-template.html | 3 ++- app/templates/views/edit-sms-template.html | 3 ++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index 67ea5e5ca..8ac5837a4 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -270,9 +270,19 @@ class SMSTemplateForm(Form): NoCommasInPlaceHolders() ] ) - process_type = SelectField(u'Use priority queue?', choices=[('normal', 'no'), - ('priority', 'yes')], - default='normal') + # process_type = SelectField(u'Use priority queue?', choices=[('normal', 'no'), + # ('priority', 'yes')], + # default='normal') + + process_type = RadioField( + 'Use priority queue?', + choices=[ + ('priority', 'Yes'), + ('normal', 'No'), + ], + validators=[DataRequired()], + default='normal' + ) class EmailTemplateForm(SMSTemplateForm): diff --git a/app/templates/views/edit-email-template.html b/app/templates/views/edit-email-template.html index 56abd029a..0ab2dd2ae 100644 --- a/app/templates/views/edit-email-template.html +++ b/app/templates/views/edit-email-template.html @@ -1,6 +1,7 @@ {% extends "withnav_template.html" %} {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} +{% from "components/radios.html" import radios %} {% block page_title %} {{ heading_action }} email template – GOV.UK Notify @@ -21,7 +22,7 @@
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }} {% if current_user.has_permissions([], admin_override=True) %} - {{ textbox(form.process_type, width='1-1') }} + {{ radios(form.process_type) }} {% endif %} {{ page_footer( 'Save', diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index a54f6544b..18de85387 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -1,6 +1,7 @@ {% extends "withnav_template.html" %} {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} +{% from "components/radios.html" import radios %} {% block page_title %} {{ heading_action }} text message template – GOV.UK Notify @@ -20,7 +21,7 @@
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=5) }} {% if current_user.has_permissions([], admin_override=True) %} - {{ textbox(form.process_type, width='1-1') }} + {{ radios(form.process_type) }} {% endif %} {{ page_footer( 'Save',