Added back the delete button

This commit is contained in:
Joren de Graaf
2026-08-11 02:27:56 +02:00
parent 8406c60182
commit 275cf62fea
3 changed files with 50 additions and 2 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
<li class="task-list__item{{ not task.isActive ? ' task-list__item--completed' : '' }}">
<form>
<form class="task-list__completion-form">
<input type="hidden" name="_token" value="{{ csrf_token('completion' ~ task.id) }}">
<input
id="task-completion-{{ task.id }}"
@@ -21,4 +21,16 @@
</label>
<a class="task-list__title" href="{{ path('app_task_edit', {'id': task.id}) }}">{{ task.title }}</a>
</form>
<form
class="task-list__remove-form"
hx-post="{{ path('app_task_delete', {'id': task.id}) }}"
hx-target="closest .task-list__item"
hx-swap="delete"
hx-confirm="Remove {{ task.title }}?"
>
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ task.id) }}">
<button class="task-list__remove" type="submit" aria-label="Remove {{ task.title }}" title="Remove {{ task.title }}">
<span class="material-symbols-outlined" aria-hidden="true">delete</span>
</button>
</form>
</li>