Add link to delete a template

This is a link not a button because:
- it’s less prominent—delete is an infrequent action
- it’s a two-step process, and only the second part changes any data (so it has
  a button)
This commit is contained in:
Chris Hill-Scott
2016-01-14 09:44:06 +00:00
parent 2554fbe0e0
commit 1e0f5c27b9
8 changed files with 126 additions and 29 deletions

View File

@@ -68,16 +68,22 @@
{% endif %}
<main id="content" role="main" class="page-container">
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="error-summary">
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul class="banner-dangerous">
{% for category, message in messages %}
<li class="flash-message">
{{ message }}
{% if 'delete' == category %}
<form method='post'>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button" name="delete" value="Yes, delete this template" />
</form>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}
{% endwith %}
{% block fullwidth_content %}{% endblock %}
</main>