mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Plug GovukRadiosField into edit sms|email pages
Proof of concept for the GovukRadiosField class. Includes the removal of the a DataRequired validator. This doesn't seem to be needed as the RadioField superclass catches any submissions without any data from field.choices in its pre_validate method (which also outputs the correct error message).
This commit is contained in:
@@ -1294,14 +1294,13 @@ class BaseTemplateForm(StripWhitespaceForm):
|
||||
NoCommasInPlaceHolders()
|
||||
]
|
||||
)
|
||||
process_type = RadioField(
|
||||
process_type = GovukRadiosField(
|
||||
"Use priority queue?",
|
||||
choices=[
|
||||
('priority', 'Yes'),
|
||||
('normal', 'No'),
|
||||
],
|
||||
thing='yes or no',
|
||||
validators=[DataRequired()],
|
||||
default='normal'
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/page-footer.html" import sticky_page_footer %}
|
||||
{% from "components/radios.html" import radios %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block service_page_title %}
|
||||
@@ -26,7 +25,7 @@
|
||||
{{ textbox(form.subject, width='1-1', highlight_placeholders=True, rows=2) }}
|
||||
{{ textbox(form.template_content, highlight_placeholders=True, width='1-1', rows=8) }}
|
||||
{% if current_user.platform_admin %}
|
||||
{{ radios(form.process_type) }}
|
||||
{{ form.process_type }}
|
||||
{% endif %}
|
||||
{{ sticky_page_footer(
|
||||
'Save'
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
{% from "components/page-footer.html" import sticky_page_footer %}
|
||||
{% from "components/radios.html" import radios %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block service_page_title %}
|
||||
@@ -27,7 +26,7 @@
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ textbox(form.template_content, highlight_placeholders=True, width='1-1', rows=5) }}
|
||||
{% if current_user.platform_admin %}
|
||||
{{ radios(form.process_type) }}
|
||||
{{ form.process_type }}
|
||||
{% endif %}
|
||||
{{ sticky_page_footer(
|
||||
'Save'
|
||||
|
||||
Reference in New Issue
Block a user