feat: add delete button to task detail and edit pages

Task detail page gets a Delete button in the header bar (matching
all other entity detail pages). Task edit form gets a Delete button
below the form. Both use confirmation dialog via data-confirm.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 16:04:45 +00:00
parent 9833f131e1
commit b5c8f305dd
2 changed files with 10 additions and 0 deletions

View File

@@ -23,6 +23,9 @@
{% endif %}
{% endif %}
<a href="/tasks/{{ item.id }}/edit" class="btn btn-secondary btn-sm">Edit</a>
<form action="/tasks/{{ item.id }}/delete" method="post" data-confirm="Delete this task?" style="display:inline">
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
</form>
<form action="/tasks/{{ item.id }}/toggle" method="post" style="display:inline">
<button class="btn {{ 'btn-secondary' if item.status == 'done' else 'btn-primary' }} btn-sm">
{{ 'Reopen' if item.status == 'done' else 'Complete' }}