Link back to all template versions from 1 version

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.
This commit is contained in:
Chris Hill-Scott
2016-06-12 14:35:58 +01:00
parent 50a81a96a3
commit 40564df15e
2 changed files with 12 additions and 1 deletions

View File

@@ -19,4 +19,9 @@
{% endwith %}
</div>
{% endblock %}
{{ 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 %}

View File

@@ -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,