From 40564df15ec3cb69e9aaa1e2f8fb307097580c6b Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Sun, 12 Jun 2016 14:35:58 +0100 Subject: [PATCH] Link back to all template versions from 1 version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you get linked to a single version of a template, you’re at a dead end. Let’s add a link to go back up a level to where you can understand the current version in context. --- app/templates/views/templates/template_history.html | 7 ++++++- tests/app/main/views/test_template_history.py | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/templates/views/templates/template_history.html b/app/templates/views/templates/template_history.html index 847e4dd69..b462435a6 100644 --- a/app/templates/views/templates/template_history.html +++ b/app/templates/views/templates/template_history.html @@ -19,4 +19,9 @@ {% endwith %} -{% endblock %} \ No newline at end of file + {{ page_footer( + secondary_link=url_for('.view_template_versions', service_id=current_service.id, template_id=template.id), + secondary_link_text='See all versions of this template' + ) }} + +{% endblock %} diff --git a/tests/app/main/views/test_template_history.py b/tests/app/main/views/test_template_history.py index fe39532c4..dd227c412 100644 --- a/tests/app/main/views/test_template_history.py +++ b/tests/app/main/views/test_template_history.py @@ -17,6 +17,11 @@ def test_view_template_version(app_, service_id = fake_uuid template_id = fake_uuid version = 1 + all_versions_link = url_for( + 'main.view_template_versions', + service_id=service_id, + template_id=template_id + ) resp = client.get(url_for( '.view_template_version', service_id=service_id, @@ -28,6 +33,7 @@ def test_view_template_version(app_, template = mock_get_template_version(service_id, template_id, version) assert api_user_active.name in resp_data assert template['data']['content'] in resp_data + assert all_versions_link in resp_data mock_get_template_version.assert_called_with( service_id, template_id,