Convert text inputs on ServiceUpdateEmailBranding

Includes changes to templates that use this form
and associated tests.
This commit is contained in:
Tom Byers
2020-08-06 15:36:34 +01:00
parent 87beaf49ae
commit a3e661830d
6 changed files with 26 additions and 18 deletions

View File

@@ -1554,13 +1554,17 @@ class PreviewBranding(StripWhitespaceForm):
class ServiceUpdateEmailBranding(StripWhitespaceForm):
name = StringField('Name of brand')
text = StringField('Text')
colour = StringField(
name = GovukTextInputField('Name of brand')
text = GovukTextInputField('Text')
colour = GovukTextInputField(
'Colour',
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code (starting with #)')
]
],
param_extensions={
"classes": "govuk-input--width-6",
"attributes": {"data-module": "colour-preview"}
}
)
file = FileField_wtf('Upload a PNG logo', validators=[FileAllowed(['png'], 'PNG Images only!')])
brand_type = RadioField(