Adds delete button to announcements list view

It's handy to have it there
This commit is contained in:
Mouse Reeve 2022-02-11 13:33:42 -05:00
parent 542957364c
commit 059fd84d06

View file

@ -38,6 +38,9 @@
{% trans "Status" as text %}
{% include 'snippets/table-sort-header.html' with field="active" sort=sort text=text %}
</th>
<th>
{% trans "Actions" %}
</th>
</tr>
{% for announcement in announcements %}
<tr>
@ -46,6 +49,15 @@
<td>{{ announcement.start_date|naturaltime|default:'' }}</td>
<td>{{ announcement.end_date|naturaltime|default:'' }}</td>
<td>{% if announcement.active %}{% trans "active" %}{% else %}{% trans "inactive" %}{% endif %}</td>
<td>
<form class="control" action="{% url 'settings-announcements-delete' announcement.id %}" method="post">
{% csrf_token %}
<button type="submit" class="button is-danger is-light is-small">
<span class="icon icon-x m-0-mobile" aria-hidden="true"></span>
<span class="is-sr-only-mobile">{% trans "Delete" %}</span>
</button>
</form>
</td>
</tr>
{% endfor %}
{% if not announcements %}