From 0fc927b4584b4a47a03ae2c3a8848210c8cb0685 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 5 Feb 2016 10:24:43 +0000 Subject: [PATCH] Review usage of secondary/back links This commit examines all the pages that use the page footer component, and determines whether they should have a back button, a secondary link, both or neither. --- app/templates/views/api-keys/create.html | 6 +----- app/templates/views/api-keys/show.html | 4 ++-- app/templates/views/edit-template.html | 4 ++-- app/templates/views/notification.html | 4 ++-- app/templates/views/service-settings/name.html | 3 ++- .../views/service-settings/request-to-go-live.html | 3 ++- app/templates/views/service-settings/status.html | 5 +++-- app/templates/views/signin.html | 2 +- app/templates/views/user-profile/change-password.html | 4 ++-- tests/app/main/views/test_service_settings.py | 2 +- 10 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/templates/views/api-keys/create.html b/app/templates/views/api-keys/create.html index 01c4b59ad..4791ece27 100644 --- a/app/templates/views/api-keys/create.html +++ b/app/templates/views/api-keys/create.html @@ -14,11 +14,7 @@
{{ textbox(key_name, hint='eg CRM application') }} - {{ page_footer( - 'Continue', - back_link=url_for('.api_keys', service_id=service_id), - back_link_text='Back to API keys' - ) }} + {{ page_footer('Continue') }}
{% endblock %} diff --git a/app/templates/views/api-keys/show.html b/app/templates/views/api-keys/show.html index 13f451339..1ba6a4d55 100644 --- a/app/templates/views/api-keys/show.html +++ b/app/templates/views/api-keys/show.html @@ -26,8 +26,8 @@ {{ page_footer( - back_link=url_for('.api_keys', service_id=service_id), - back_link_text='Back to API keys' + secondary_link=url_for('.api_keys', service_id=service_id), + secondary_link_text='Back to API keys' ) }} {% endblock %} diff --git a/app/templates/views/edit-template.html b/app/templates/views/edit-template.html index f2776751c..c591acacb 100644 --- a/app/templates/views/edit-template.html +++ b/app/templates/views/edit-template.html @@ -26,8 +26,8 @@ GOV.UK Notify | Edit template 'Save', delete_link=url_for('.delete_service_template', service_id=service_id, template_id=template_id) if template_id or None, delete_link_text='delete this template', - back_link=url_for('.manage_service_templates', service_id=service_id), - back_link_text='Back to templates' + secondary_link=url_for('.manage_service_templates', service_id=service_id), + secondary_link_text='Back to templates' ) }} diff --git a/app/templates/views/notification.html b/app/templates/views/notification.html index 78da91d3d..3303885a5 100644 --- a/app/templates/views/notification.html +++ b/app/templates/views/notification.html @@ -26,8 +26,8 @@ GOV.UK Notify | Notifications activity {{ page_footer( - back_link = url_for('.view_job', service_id=service_id, job_id=job_id), - back_link_text = 'View other messages in this job' + secondary_link = url_for('.view_job', service_id=service_id, job_id=job_id), + secondary_link_text = 'View other messages in this job' ) }} {% endblock %} diff --git a/app/templates/views/service-settings/name.html b/app/templates/views/service-settings/name.html index 67f87b619..f28988794 100644 --- a/app/templates/views/service-settings/name.html +++ b/app/templates/views/service-settings/name.html @@ -24,7 +24,8 @@ GOV.UK Notify | Service settings {{ textbox(form.name) }} {{ page_footer( 'Save', - back_link=url_for('.service_settings', service_id=service_id) + back_link=url_for('.service_settings', service_id=service_id), + back_link_text='Back to settings' ) }} diff --git a/app/templates/views/service-settings/request-to-go-live.html b/app/templates/views/service-settings/request-to-go-live.html index 104a84052..a4805e95e 100644 --- a/app/templates/views/service-settings/request-to-go-live.html +++ b/app/templates/views/service-settings/request-to-go-live.html @@ -39,7 +39,8 @@
{{ page_footer( 'Send request', - back_link=url_for('.service_settings', service_id=service_id) + back_link=url_for('.service_settings', service_id=service_id), + back_link_text='Back to settings' ) }}
diff --git a/app/templates/views/service-settings/status.html b/app/templates/views/service-settings/status.html index ba5ef5421..384c67636 100644 --- a/app/templates/views/service-settings/status.html +++ b/app/templates/views/service-settings/status.html @@ -23,9 +23,10 @@ GOV.UK Notify | Service settings
{{ page_footer( - 'Turn off all outgoing notifications', + 'Suspend API keys', destructive=True, - back_link=url_for('.service_settings', service_id=service_id) + back_link=url_for('.service_settings', service_id=service_id), + back_link_text='Back to settings' ) }}
diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 845edeb29..e886e673e 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -17,7 +17,7 @@ Sign in
{{ textbox(form.email_address) }} {{ textbox(form.password) }} - {{ page_footer("Continue", back_link=url_for('.forgot_password'), back_link_text="Forgotten password?") }} + {{ page_footer("Continue", secondary_link=url_for('.forgot_password'), secondary_link_text="Forgotten password?") }}
diff --git a/app/templates/views/user-profile/change-password.html b/app/templates/views/user-profile/change-password.html index 3669dd10c..52058e0c2 100644 --- a/app/templates/views/user-profile/change-password.html +++ b/app/templates/views/user-profile/change-password.html @@ -17,8 +17,8 @@ GOV.UK Notify | Service settings {{ textbox(form.new_password) }} {{ page_footer( 'Save', - back_link=url_for('.user_profile'), - back_link_text="Back to your profile" + secondary_link=url_for('.user_profile'), + secondary_link_text="Back to your profile" ) }} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 0f87134fd..045cc4c86 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -161,7 +161,7 @@ def test_should_show_status_page(app_, assert response.status_code == 200 resp_data = response.get_data(as_text=True) - assert 'Turn off all outgoing notifications' in resp_data + assert 'Suspend API keys' in resp_data assert mock_get_service.called