Replace the htmx-only delete button for payments with a form

This way, it also works without JavaScript, that is not that important,
maybe, but i like that it does.
This commit is contained in:
jordi fita mas 2024-09-09 11:33:10 +02:00
parent 193409eed8
commit ce4d29b83b
1 changed files with 11 additions and 8 deletions

View File

@ -105,15 +105,18 @@
</a>
</li>
<li role="presentation">
<button role="menuitem"
data-hx-delete="{{ $.BaseURI }}/{{ .Slug }}"
data-hx-confirm="{{ $confirm }}"
data-hx-headers='{ {{ csrfHeader }} }'
data-hx-target="main"
<form method="POST" action="{{ $.BaseURI }}/{{ .Slug }}"
data-hx-boost="true"
data-hx-target="main"
data-hx-confirm="{{ $confirm }}"
>
<i class="ri-delete-back-2-line"></i>
{{( pgettext "Remove" "action" )}}
</button>
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" role="menuitem">
<i class="ri-delete-back-2-line"></i>
{{( pgettext "Remove" "action" )}}
</button>
</form>
</li>
</ul>
</details>