Move delete link from edit to view template page

Users were having trouble finding the delete template link. It sort of
made sense having it on the edit page before we had the view template
page. But it doesn’t make sense now – having to choose to ‘edit’ the
template before you can delete is counterintuitive.

The single template page is where you go to choose an action to perform
on your template. Deleting is a good example of an action you can
perform on a template.

So this commit moves the delete link from the edit template page to the
view template page.

It also puts the confirm banner on same page as the delete link

The idea being that, in order to make a decision about whether to delete
the template, it’s useful to be able to see the template you’re
deleting. There’s no user need to edit the template before you delete
it.
This commit is contained in:
Chris Hill-Scott
2017-04-18 13:01:58 +01:00
parent c86e195911
commit d5b78fac17
5 changed files with 23 additions and 17 deletions

View File

@@ -23,9 +23,7 @@
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
'Save',
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template_id) if template_id or None,
delete_link_text='Delete this template'
'Save'
) }}
</div>
<aside class="column-whole">

View File

@@ -19,9 +19,7 @@
{{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }}
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }}
{{ page_footer(
'Save',
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template_id) if template_id or None,
delete_link_text='Delete this template'
'Save'
) }}
</div>
<aside class="column-three-quarters">

View File

@@ -24,9 +24,7 @@
{{ radios(form.process_type) }}
{% endif %}
{{ page_footer(
'Save',
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template_id) if template_id or None,
delete_link_text='Delete this template'
'Save'
) }}
</div>
<aside class="column-whole">

View File

@@ -23,7 +23,7 @@
</div>
{% if template._template.updated_at %}
<div class="bottom-gutter-2">
<div class="bottom-gutter">
<h2 class="heading-small">Last edited {{ template._template.updated_at|format_delta }}</h2>
<p>
<a href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous versions</a>
@@ -31,4 +31,13 @@
</div>
{% endif %}
{% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %}
<div class="bottom-gutter">
{{ page_footer(
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template.id),
delete_link_text='Delete this template'
) }}
</div>
{% endif %}
{% endblock %}