websocket checkboxes

This commit is contained in:
JurajKubrican
2024-12-28 18:49:49 +01:00
parent 6aee06da49
commit 73054d4325
5 changed files with 144 additions and 30 deletions

10
views/boxes.html Normal file
View File

@@ -0,0 +1,10 @@
{{block "boxes" .}}
{{range $index, $value := .}}
<input type="checkbox" id="box-{{$index}}" name="checked" {{if $value}}checked{{end}}
hx-post="/box/{{$index}}"
hx-vals='{"value": this.checked}'
hx-trigger="change"
hx-encoding="none"
>
{{end}}
{{end}}