New columns for email branding

Added banner_colour, single_id_colour and domain to email branding view. Now able to set the fields.

However, the new fields are not being used yet.
This commit is contained in:
Rebecca Law
2018-08-20 13:27:17 +01:00
parent b6d56af9d4
commit 3fda171f80
7 changed files with 111 additions and 22 deletions

View File

@@ -731,6 +731,7 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm):
name = StringField('Name of brand')
text = StringField('Text')
domain = StringField('Domain')
colour = StringField(
'Colour',
render_kw={'onchange': 'update_colour(this)'},
@@ -738,6 +739,20 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm):
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
banner_colour = StringField(
'Banner colour',
render_kw={'onchange': 'update_colour(this)'},
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
single_id_colour = StringField(
'Single identity colour',
render_kw={'onchange': 'update_colour(this)'},
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
file = FileField_wtf('Upload a PNG logo', validators=[FileAllowed(['png'], 'PNG Images only!')])
@@ -745,6 +760,7 @@ class ServiceCreateEmailBranding(StripWhitespaceForm):
name = StringField('Name of brand')
text = StringField('Text')
domain = StringField('Domain')
colour = StringField(
'Colour',
render_kw={'onchange': 'update_colour(this)'},
@@ -752,6 +768,20 @@ class ServiceCreateEmailBranding(StripWhitespaceForm):
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
banner_colour = StringField(
'Banner colour',
render_kw={'onchange': 'update_colour(this)'},
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
single_id_colour = StringField(
'Single identity colour',
render_kw={'onchange': 'update_colour(this)'},
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
]
)
file = FileField_wtf('Upload a PNG logo', validators=[FileAllowed(['png'], 'PNG Images only!')])