Only show relevant choices of email branding

Users who work in local government can’t have GOV.UK branding on their
emails. And only those working for Companies House (for example) can
request the Companies House branding.

This commit adds:
- new choices of email branding, which offer the name of the branding,
  rather than the style
- logic to filter this list to only the applicable options, based on
  what we know about the user, service and organisation

This is a change from the previous approach which put the onus on users
to figure out the style of branding they wanted, when we might already
know that a lot of the options weren’t available to them, or would be
inconsistent with the branding of other services in their organisation.
This commit is contained in:
Chris Hill-Scott
2019-09-12 13:45:35 +01:00
parent 29a0611e42
commit 6d0d10e8de
7 changed files with 235 additions and 89 deletions

View File

@@ -102,7 +102,7 @@
{% call settings_row(if_has_permission='email') %}
{{ text_field('Email branding') }}
{{ text_field('Your branding<br> ({})'.format(current_service.email_branding_name)|safe if current_service.email_branding else current_service.email_branding_name) }}
{{ text_field(current_service.email_branding_name) }}
{{ edit_field(
'Change',
url_for('.branding_request', service_id=current_service.id),

View File

@@ -1,5 +1,5 @@
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radio %}
{% from "components/radios.html" import radios %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
@@ -17,26 +17,7 @@
) }}
{% call form_wrapper() %}
<fieldset class="form-group {% if form.options.errors %}form-group-error{% endif %} top-gutter">
<legend class="bottom-gutter-2-3">
Choose the branding youd like on your emails.
</legend>
{% if form.options.errors %}
<span class="error-message" data-module="track-error" data-error-type="Cant be empty" data-error-label="{{ form.options.name }}">
You need to choose an option
</span>
{% endif %}
<div class="grid-row">
{% for option in form.options %}
<div class="column-one-quarter">
<label for="{{ option.id }}">
<img src="{{ asset_url('images/branding-options/{}.png'.format(option.data)) }}" alt="" class="bordered-image bottom-gutter-1-3">
</label>
{{ radio(option) }}
</div>
{% endfor %}
</div>
</fieldset>
{{ radios(form.options) }}
<p class="form-group">
Well email you once your brandings ready to use, or if we need any
more information.