From f64672e23bb7c9dff607fac87811b21fcf529102 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 23 Feb 2017 15:34:13 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20page=20titles=20that=20didn=E2=80=99t=20g?= =?UTF-8?q?et=20fixed=20before?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Did most of this work in: https://github.com/alphagov/notifications-admin/pull/1118 > In pages specific to a service (e.g. dashboard and sub pages) the > title needs to distinguish which service it applies to. This is mainly > to give context to screen reader users who could be managing multiple > services. > > Implementing this uses template inheritance: > > `page_title` includes `per_page_title` includes `service_page_title` > > ‘GOV.UK Notify’ is inserted into every page title. > > Pages that set `service_page_title` get the service name inserted too. --- app/templates/error/400.html | 2 +- app/templates/error/401.html | 2 +- app/templates/error/403.html | 2 +- app/templates/error/404.html | 2 +- app/templates/error/410.html | 2 +- app/templates/error/500.html | 2 +- app/templates/views/dashboard/all-template-statistics.html | 4 ++-- app/templates/views/dashboard/monthly.html | 3 +-- app/templates/views/user-profile/authenticate.html | 4 ++-- app/templates/views/user-profile/change-password.html | 6 +++--- app/templates/views/user-profile/change.html | 4 ++-- app/templates/views/user-profile/confirm.html | 4 ++-- 12 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/templates/error/400.html b/app/templates/error/400.html index 8b4ea5842..ce9c4f2bc 100644 --- a/app/templates/error/400.html +++ b/app/templates/error/400.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Bad Request{% endblock %} +{% block per_page_title %}Bad Request{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/401.html b/app/templates/error/401.html index 32576ff75..f6960986e 100644 --- a/app/templates/error/401.html +++ b/app/templates/error/401.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Unauthorized{% endblock %} +{% block per_page_title %}Unauthorized{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/403.html b/app/templates/error/403.html index 770e2dc74..105933b94 100644 --- a/app/templates/error/403.html +++ b/app/templates/error/403.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Forbidden{% endblock %} +{% block per_page_title %}Forbidden{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/404.html b/app/templates/error/404.html index 3768b37d7..cf691522f 100644 --- a/app/templates/error/404.html +++ b/app/templates/error/404.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Page not found{% endblock %} +{% block per_page_title %}Page not found{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/410.html b/app/templates/error/410.html index df62a85ca..3e734e10a 100644 --- a/app/templates/error/410.html +++ b/app/templates/error/410.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Page not found{% endblock %} +{% block per_page_title %}Page not found{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/error/500.html b/app/templates/error/500.html index cdbd2a58d..488db2d7d 100644 --- a/app/templates/error/500.html +++ b/app/templates/error/500.html @@ -1,5 +1,5 @@ {% extends "withoutnav_template.html" %} -{% block page_title %}Server error{% endblock %} +{% block per_page_title %}Server error{% endblock %} {% block maincolumn_content %}
diff --git a/app/templates/views/dashboard/all-template-statistics.html b/app/templates/views/dashboard/all-template-statistics.html index 909a1e9df..d696ab9be 100644 --- a/app/templates/views/dashboard/all-template-statistics.html +++ b/app/templates/views/dashboard/all-template-statistics.html @@ -1,7 +1,7 @@ {% extends "withnav_template.html" %} -{% block page_title %} - {{ current_service.name }} – GOV.UK Notify +{% block service_page_title %} + {{ current_service.name }} {% endblock %} {% block maincolumn_content %} diff --git a/app/templates/views/dashboard/monthly.html b/app/templates/views/dashboard/monthly.html index 975fe08f4..74f8362f9 100644 --- a/app/templates/views/dashboard/monthly.html +++ b/app/templates/views/dashboard/monthly.html @@ -5,10 +5,9 @@ {% extends "withnav_template.html" %} -{% block page_title %} +{% block service_page_title %} Activity breakdown {{ selected_year }} to {{ selected_year + 1 }} financial year - – GOV.UK Notify {% endblock %} {% block maincolumn_content %} diff --git a/app/templates/views/user-profile/authenticate.html b/app/templates/views/user-profile/authenticate.html index 6abcccbff..9a5da89ab 100644 --- a/app/templates/views/user-profile/authenticate.html +++ b/app/templates/views/user-profile/authenticate.html @@ -2,8 +2,8 @@ {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} -{% block page_title %} -GOV.UK Notify | Service settings +{% block per_page_title %} + Change your {{ thing }} {% endblock %} {% block maincolumn_content %} diff --git a/app/templates/views/user-profile/change-password.html b/app/templates/views/user-profile/change-password.html index 477458139..e0e9a258b 100644 --- a/app/templates/views/user-profile/change-password.html +++ b/app/templates/views/user-profile/change-password.html @@ -2,13 +2,13 @@ {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} -{% block page_title %} -GOV.UK Notify | Service settings +{% block per_page_title %} + Change your password {% endblock %} {% block maincolumn_content %} -

Change your password

+

Change your password

diff --git a/app/templates/views/user-profile/change.html b/app/templates/views/user-profile/change.html index 9554dd5a7..a0b3aea65 100644 --- a/app/templates/views/user-profile/change.html +++ b/app/templates/views/user-profile/change.html @@ -2,8 +2,8 @@ {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} -{% block page_title %} -GOV.UK Notify | Service settings +{% block per_page_title %} + Change your {{ thing }} {% endblock %} {% block maincolumn_content %} diff --git a/app/templates/views/user-profile/confirm.html b/app/templates/views/user-profile/confirm.html index c0a488169..8acf8bcc9 100644 --- a/app/templates/views/user-profile/confirm.html +++ b/app/templates/views/user-profile/confirm.html @@ -2,8 +2,8 @@ {% from "components/textbox.html" import textbox %} {% from "components/page-footer.html" import page_footer %} -{% block page_title %} -GOV.UK Notify | Service settings +{% block per_page_title %} + Change your {{ thing }} {% endblock %} {% block maincolumn_content %}