fix: move channel delete-panel out of edit form (nested form bug)

The delete-panel <form action='.../delete'> was nested inside the
main <form action='.../edit'>. HTML doesn't allow nested forms —
browsers parse the inner form as if it didn't exist, so clicking
'Delete permanently' submitted the outer edit form to /edit
instead of /delete, leaving the channel intact.

Move the delete-panel block to a sibling of the main form. The
'Delete channel…' button still toggles its visibility via JS, the
panel still renders inside the page layout, and now its form
actually posts to the delete handler.
This commit is contained in:
2026-05-04 22:35:58 +01:00
parent 38683b4e64
commit 4e95ad4c87
+2 -2
View File
@@ -405,6 +405,8 @@
</div> </div>
{{/* ---------- typed-confirm delete ---------- */}} {{/* ---------- typed-confirm delete ---------- */}}
</form>{{/* close ch-form — delete panel must live OUTSIDE because HTML forbids nested forms */}}
{{if $isEdit}} {{if $isEdit}}
<div id="delete-panel" class="hidden mt-4 panel rounded-[7px] p-[18px]" <div id="delete-panel" class="hidden mt-4 panel rounded-[7px] p-[18px]"
style="border-color: color-mix(in oklch, var(--bad), transparent 60%);"> style="border-color: color-mix(in oklch, var(--bad), transparent 60%);">
@@ -419,8 +421,6 @@
</form> </form>
</div> </div>
{{end}} {{end}}
</form>{{/* close ch-form */}}
</div> </div>
{{/* ---------- right rail — payload preview ---------- */}} {{/* ---------- right rail — payload preview ---------- */}}