From 1269071da26f91710f50e9993c2a3533b705bc08 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 9 Aug 2018 16:24:22 +0100 Subject: [PATCH] Add 'name' field to brand creation/edit page --- app/main/forms.py | 6 ++++-- app/main/views/email_branding.py | 2 ++ app/notify_client/email_branding_client.py | 3 ++- app/templates/views/email-branding/manage-branding.html | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index 746809b8c..6f7833184 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -729,7 +729,8 @@ class ServiceSelectEmailBranding(StripWhitespaceForm): class ServiceUpdateEmailBranding(StripWhitespaceForm): - name = StringField('Name') + name = StringField('Name of brand') + text = StringField('Text') colour = StringField( 'Colour', render_kw={'onchange': 'update_colour(this)'}, @@ -742,7 +743,8 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm): class ServiceCreateEmailBranding(StripWhitespaceForm): - name = StringField('Name') + name = StringField('Name of brand') + text = StringField('Text') colour = StringField( 'Colour', render_kw={'onchange': 'update_colour(this)'}, diff --git a/app/main/views/email_branding.py b/app/main/views/email_branding.py index 11e8d18f7..60a9745d7 100644 --- a/app/main/views/email_branding.py +++ b/app/main/views/email_branding.py @@ -78,12 +78,14 @@ def update_email_branding(branding_id, logo=None): branding_id=branding_id, logo=logo, name=form.name.data, + text=form.text.data, colour=form.colour.data ) return redirect(url_for('.email_branding', branding_id=branding_id)) form.name.data = email_branding['name'] + form.text.data = email_branding['text'] form.colour.data = email_branding['colour'] return render_template( diff --git a/app/notify_client/email_branding_client.py b/app/notify_client/email_branding_client.py index 37651761c..59ebbde3f 100644 --- a/app/notify_client/email_branding_client.py +++ b/app/notify_client/email_branding_client.py @@ -24,10 +24,11 @@ class EmailBrandingClient(NotifyAdminAPIClient): } return self.post(url="/email-branding", data=data) - def update_email_branding(self, branding_id, logo, name, colour): + def update_email_branding(self, branding_id, logo, name, text, colour): data = { "logo": logo, "name": name, + "text": text, "colour": colour } return self.post(url="/email-branding/{}".format(branding_id), data=data) diff --git a/app/templates/views/email-branding/manage-branding.html b/app/templates/views/email-branding/manage-branding.html index b64fa9db0..d8927ad65 100644 --- a/app/templates/views/email-branding/manage-branding.html +++ b/app/templates/views/email-branding/manage-branding.html @@ -22,6 +22,7 @@
{{textbox(form.name)}}
+
{{textbox(form.text)}}
{{colour_textbox(form.colour, width='1-4', colour=email_branding.colour if email_branding)}} {{ page_footer( 'Save',