mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Add an ‘add logo’ button
Because some people don’t know they can put their own logo on letters: > The HM Government Logo is at the top of the letter and we can't see > a way of putting the [organisation] logo on > We are intending to use the letter template feature for the first time > and wondered whether the branding is configurable or whether the HM > Government header is the standard default. > Can we replace HM Government logo with our own in the letter? IF yes, > then how? > I don't seem to be able to set the branding on the letters to be > [organisation]. it's always HM government. Is there something that > needs enabling for this account? No-one actually wants the HM Government logo (no-one is sending real letters using it). So we should leave the space blank and put a button there prompting people to add their own logo.
This commit is contained in:
@@ -45,3 +45,9 @@
|
||||
top: 51px; // aligns bottom edge to bottom of postmark
|
||||
right: 145px; // Aligns right edge to midpoint of postmark and fold
|
||||
}
|
||||
|
||||
.edit-template-link-letter-branding {
|
||||
@extend %edit-template-link;
|
||||
top: 51px; // aligns with ‘change postage’ link
|
||||
left: 66px; // Aligns to left of logo area
|
||||
}
|
||||
|
||||
@@ -829,6 +829,7 @@ def service_set_letter_branding(service_id):
|
||||
def request_letter_branding(service_id):
|
||||
return render_template(
|
||||
'views/service-settings/request-letter-branding.html',
|
||||
from_template=request.args.get('from_template'),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -22,10 +22,17 @@
|
||||
<a href="{{ url_for('main.feedback', ticket_type='ask-question-give-feedback', body='letter-branding') }}">Contact support</a>
|
||||
if you want to use a different logo.
|
||||
</p>
|
||||
{{ page_footer(
|
||||
back_link=url_for('.service_settings', service_id=current_service.id),
|
||||
back_link_text='Back to settings'
|
||||
) }}
|
||||
{% if from_template %}
|
||||
{{ page_footer(
|
||||
back_link=url_for('.view_template', service_id=current_service.id, template_id=from_template),
|
||||
back_link_text='Back to template'
|
||||
) }}
|
||||
{% else %}
|
||||
{{ page_footer(
|
||||
back_link=url_for('.service_settings', service_id=current_service.id),
|
||||
back_link_text='Back to settings'
|
||||
) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
</div>
|
||||
<div class="column-whole template-container">
|
||||
{% if current_user.has_permissions('manage_templates') and template.template_type == 'letter' %}
|
||||
<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(".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>
|
||||
<a href="{{ url_for(".set_template_sender", service_id=current_service.id, template_id=template.id) }}" class="edit-template-link-letter-contact">Edit</a>
|
||||
|
||||
@@ -34,6 +34,8 @@ from tests.conftest import (
|
||||
platform_admin_user,
|
||||
)
|
||||
|
||||
FAKE_TEMPLATE_ID = uuid4()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_get_service_settings_page_common(
|
||||
@@ -2032,12 +2034,12 @@ def test_set_letter_contact_block_redirects_to_template(
|
||||
mock_update_service,
|
||||
):
|
||||
service_one['permissions'] = ['letter']
|
||||
fake_template_id = uuid4()
|
||||
|
||||
response = logged_in_client.post(
|
||||
url_for(
|
||||
'main.service_set_letter_contact_block',
|
||||
service_id=service_one['id'],
|
||||
from_template=fake_template_id,
|
||||
from_template=FAKE_TEMPLATE_ID,
|
||||
),
|
||||
data={'letter_contact_block': '23 Whitechapel Road'},
|
||||
)
|
||||
@@ -2045,7 +2047,7 @@ def test_set_letter_contact_block_redirects_to_template(
|
||||
assert response.location == url_for(
|
||||
'main.view_template',
|
||||
service_id=service_one['id'],
|
||||
template_id=fake_template_id,
|
||||
template_id=FAKE_TEMPLATE_ID,
|
||||
_external=True,
|
||||
)
|
||||
|
||||
@@ -2066,14 +2068,26 @@ def test_set_letter_contact_block_has_max_10_lines(
|
||||
assert error_message == 'Contains 11 lines, maximum is 10'
|
||||
|
||||
|
||||
@pytest.mark.parametrize('extra_args, expected_partial_url', (
|
||||
(
|
||||
{},
|
||||
partial(url_for, 'main.service_settings')
|
||||
),
|
||||
(
|
||||
{'from_template': FAKE_TEMPLATE_ID},
|
||||
partial(url_for, 'main.view_template', template_id=FAKE_TEMPLATE_ID)
|
||||
),
|
||||
))
|
||||
def test_request_letter_branding(
|
||||
client_request,
|
||||
mock_get_letter_branding_by_id,
|
||||
service_one
|
||||
extra_args,
|
||||
expected_partial_url,
|
||||
):
|
||||
request_page = client_request.get(
|
||||
'main.request_letter_branding',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
**extra_args
|
||||
)
|
||||
assert request_page.select_one('main p').text.strip() == 'Your letters have no logo.'
|
||||
link_href = request_page.select_one('main a')['href']
|
||||
@@ -2081,6 +2095,8 @@ def test_request_letter_branding(
|
||||
assert feedback_page.select_one('textarea').text.strip() == (
|
||||
'I would like my own logo on my letter templates.'
|
||||
)
|
||||
back_link_href = request_page.select('main a')[1]['href']
|
||||
assert back_link_href == expected_partial_url(service_id=SERVICE_ONE_ID)
|
||||
|
||||
|
||||
def test_request_letter_branding_if_already_have_branding(
|
||||
|
||||
Reference in New Issue
Block a user