Merge pull request #3268 from alphagov/proper-form-for-letter-branding

Parametrise branding request flow so it serves both email and letter branding
This commit is contained in:
Pea M. Tyczynska
2020-01-23 16:50:41 +00:00
committed by GitHub
10 changed files with 351 additions and 166 deletions

View File

@@ -105,7 +105,7 @@
{{ text_field(current_service.email_branding_name) }}
{{ edit_field(
'Change',
url_for('.branding_request', service_id=current_service.id),
url_for('.branding_request', service_id=current_service.id, branding_type="email"),
permissions=['manage_service'],
)}}
{% endcall %}
@@ -241,7 +241,7 @@
{{ optional_text_field(current_service.letter_branding.name) }}
{{ edit_field(
'Change',
url_for('.request_letter_branding', service_id=current_service.id),
url_for('.branding_request', service_id=current_service.id, branding_type="letter"),
permissions=['manage_service']
)}}
{% endcall %}

View File

@@ -7,21 +7,21 @@
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
Change email branding
Change {{ branding_type }} branding
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
'Change email branding',
back_link=url_for('main.service_settings', service_id=current_service.id)
'Change {} branding'.format(branding_type),
back_link=url_for('.view_template', service_id=current_service.id, template_id=from_template) if from_template else url_for('.service_settings', service_id=current_service.id)
) }}
<p>
Your emails currently have {{ current_service.email_branding_name }} branding.
Your {{ branding_type }}s currently have {{ branding_name }} branding.
</p>
{% if current_service.needs_to_change_email_branding %}
{% if current_service.needs_to_change_email_branding and branding_type == "email" %}
<p>
You should be using your own branding instead. We can help you to set this up.
</p>

View File

@@ -1,39 +0,0 @@
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Letter branding
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
'Letter branding',
back_link=url_for('.view_template', service_id=current_service.id, template_id=from_template) if from_template else url_for('.service_settings', service_id=current_service.id)
) }}
<div class="grid-row">
<div class="column-three-quarters">
{% if current_service.letter_branding_id %}
<p>
Your letters have the {{ current_service.letter_branding.name }} logo.
</p>
<p>
<a href="{{ url_for('main.feedback', ticket_type='ask-question-give-feedback', body='letter-branding') }}">Contact us</a>
if you want to use a different logo.
</p>
{% else %}
<p>
Your letters do not have a logo.
</p>
<p>
<a href="{{ url_for('main.feedback', ticket_type='ask-question-give-feedback', body='letter-branding') }}">Contact us</a>
if you want to add your organisations logo.
</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -51,7 +51,7 @@
<div class="column-whole template-container">
{% if current_user.has_permissions('manage_templates') and template.template_type == 'letter' %}
{% if not current_service.letter_branding_id %}
<a href="{{ url_for(".request_letter_branding", service_id=current_service.id, from_template=template.id) }}" class="edit-template-link-letter-branding">Add logo</a>
<a href="{{ url_for(".branding_request", service_id=current_service.id, branding_type="letter", from_template=template.id) }}" class="edit-template-link-letter-branding">Add logo</a>
{% endif %}
<a href="{{ url_for(".edit_template_postage", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-postage">Change</a>
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-body">Edit</a>