mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-26 02:49:16 -04:00
Convert BaseTemplateForm to use new fields
Updates StringField to GovukTextInputField. These changes also affect the following forms that inherit from BaseTemplateForm: - SMSTemplateForm - EmailTemplateForm Includes changes to templates that use these forms and associated tests.
This commit is contained in:
@@ -1180,19 +1180,19 @@ class ConfirmPasswordForm(StripWhitespaceForm):
|
||||
|
||||
|
||||
class BaseTemplateForm(StripWhitespaceForm):
|
||||
name = StringField(
|
||||
u'Template name',
|
||||
name = GovukTextInputField(
|
||||
"Template name",
|
||||
validators=[DataRequired(message="Cannot be empty")])
|
||||
|
||||
template_content = TextAreaField(
|
||||
u'Message',
|
||||
"Message",
|
||||
validators=[
|
||||
DataRequired(message="Cannot be empty"),
|
||||
NoCommasInPlaceHolders()
|
||||
]
|
||||
)
|
||||
process_type = RadioField(
|
||||
'Use priority queue?',
|
||||
"Use priority queue?",
|
||||
choices=[
|
||||
('priority', 'Yes'),
|
||||
('normal', 'No'),
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
{% call form_wrapper() %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ textbox(form.name, width='1-1', hint='Your recipients will not see this') }}
|
||||
{{ form.name(param_extensions={
|
||||
"classes": "govuk-!-width-full",
|
||||
"hint": {"text": "Your recipients will not see this"},
|
||||
}) }}
|
||||
</div>
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ textbox(form.template_content, highlight_placeholders=True, width='1-1', rows=5) }}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
{% call form_wrapper() %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-five-sixths">
|
||||
{{ textbox(form.name, width='1-1', hint='Your recipients will not see this', rows=10) }}
|
||||
{{ form.name(param_extensions={
|
||||
"classes": "govuk-!-width-full",
|
||||
"hint": {"text": "Your recipients will not see this"}
|
||||
}) }}
|
||||
{{ 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 %}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
{% call form_wrapper() %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-five-sixths">
|
||||
{{ textbox(form.name, width='1-1', hint='Your recipients will not see this', rows=10) }}
|
||||
{{ form.name(param_extensions={
|
||||
"classes": "govuk-!-width-full",
|
||||
"hint": {"text": "Your recipients will not see this"}
|
||||
}) }}
|
||||
{{ textbox(form.subject, width='1-1', highlight_placeholders=True, rows=2) }}
|
||||
{{ textbox(form.template_content, highlight_placeholders=True, width='1-1', rows=8) }}
|
||||
{{ sticky_page_footer(
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
{% call form_wrapper() %}
|
||||
<div class="govuk-grid-row">
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ textbox(form.name, width='1-1', hint='Your recipients will not see this') }}
|
||||
{{ form.name(param_extensions={
|
||||
"classes": "govuk-!-width-full",
|
||||
"hint": {"text": "Your recipients will not see this"}
|
||||
}) }}
|
||||
</div>
|
||||
<div class="govuk-grid-column-two-thirds">
|
||||
{{ textbox(form.template_content, highlight_placeholders=True, width='1-1', rows=5) }}
|
||||
|
||||
Reference in New Issue
Block a user