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:58 +00:00
parent fc004262a4
commit 5035075758
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' }}

View File

@@ -116,4 +116,11 @@
</div>
</form>
</div>
{% if item %}
<div style="margin-top:12px;text-align:right;">
<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 Task</button>
</form>
</div>
{% endif %}
{% endblock %}