Update email preview page

No longer requires the branding_type GET param.

Retains the 'govuk' default brand.
This commit is contained in:
Tom Byers
2018-08-29 16:16:15 +01:00
parent 0df88ea182
commit 151488fa78
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
const $paneWrapper = $('<div class="column-full"></div>'); const $paneWrapper = $('<div class="column-full"></div>');
const $form = $('form'); const $form = $('form');
const $previewPane = $('<iframe src="/_email?' + const $previewPane = $('<iframe src="/_email?' +
buildQueryString(['branding_style', branding_style]) + buildQueryString(['branding_style', branding_style]) +
'" class="email-branding-preview"></iframe>'); '" class="email-branding-preview"></iframe>');
+7 -4
View File
@@ -80,17 +80,20 @@ def design_content():
@main.route('/_email') @main.route('/_email')
def email_template(): def email_template():
branding_type = request.args.get('branding_type', 'govuk') branding_type = 'govuk'
branding_style = request.args.get('branding_style', 'None') branding_style = request.args.get('branding_style', None)
if branding_type == 'govuk' or branding_style == 'None': if branding_style:
email_branding = email_branding_client.get_email_branding(branding_style)['email_branding']
branding_type = email_branding['brand_type']
if branding_type == 'govuk':
brand_name = None brand_name = None
brand_colour = None brand_colour = None
brand_logo = None brand_logo = None
govuk_banner = True govuk_banner = True
brand_banner = False brand_banner = False
else: else:
email_branding = email_branding_client.get_email_branding(branding_style)['email_branding']
colour = email_branding['colour'] colour = email_branding['colour']
brand_name = email_branding['text'] brand_name = email_branding['text']
brand_colour = colour brand_colour = colour