Add GOV.UK Design System style back links

The Design System has standardised on back links being at the top of the
page, decorated with a small text-coloured arrow.

I think this makes more sense than having them at the bottom, because it
suggests, in some way, being able to go back before commiting to any of
the forms on the page. Whereas the things at the bottom of the page
should be performing actions on what’s in the page.

The reason for making this change now is that it de-clutters the area
around the green buttons. This was presenting a design challenge where
multiple levels of interaction were happening in the same form. Moving
these back links to the top of the page should mean that, in these
complicated forms, there’s one fewer thing to compete for the user’s
attention.

I’ve componentised this into a `page_header` macro so that the change is
easier to roll out and maintain.
This commit is contained in:
Chris Hill-Scott
2019-04-29 11:44:05 +01:00
parent a97956e571
commit 74fb30ce5f
83 changed files with 601 additions and 516 deletions

View File

@@ -1275,8 +1275,8 @@ def test_should_not_allow_creation_of_template_through_form_without_correct_perm
_follow_redirects=True,
)
assert normalize_spaces(page.select('main p')[0].text) == expected_error
assert page.select(".page-footer-back-link")[0].text == "Back to templates"
assert page.select(".page-footer-back-link")[0]['href'] == url_for(
assert page.select(".govuk-back-link")[0].text == "Back"
assert page.select(".govuk-back-link")[0]['href'] == url_for(
'.choose_template',
service_id=SERVICE_ONE_ID,
template_id='0',
@@ -1301,8 +1301,8 @@ def test_should_not_allow_creation_of_a_template_without_correct_permission(
)
assert page.select('main p')[0].text.strip() == \
"Sending {} has been disabled for your service.".format(template_description[type_of_template])
assert page.select(".page-footer-back-link")[0].text == "Back to templates"
assert page.select(".page-footer-back-link")[0]['href'] == url_for(
assert page.select(".govuk-back-link")[0].text == "Back"
assert page.select(".govuk-back-link")[0]['href'] == url_for(
'.choose_template',
service_id=service_one['id'],
template_id='0',
@@ -1418,8 +1418,8 @@ def test_should_not_allow_template_edits_without_correct_permission(
)
assert page.select('main p')[0].text.strip() == "Sending text messages has been disabled for your service."
assert page.select(".page-footer-back-link")[0].text == "Back to the template"
assert page.select(".page-footer-back-link")[0]['href'] == url_for(
assert page.select(".govuk-back-link")[0].text == "Back"
assert page.select(".govuk-back-link")[0]['href'] == url_for(
'.view_template',
service_id=SERVICE_ONE_ID,
template_id=fake_uuid,
@@ -1539,7 +1539,7 @@ def test_should_show_interstitial_when_making_breaking_change(
)
assert page.h1.string.strip() == "Confirm changes"
assert page.find('a', {'class': 'page-footer-back-link'})['href'] == url_for(
assert page.find('a', {'class': 'govuk-back-link'})['href'] == url_for(
".edit_service_template",
service_id=SERVICE_ONE_ID,
template_id=fake_uuid,