28 lines
729 B
HTML
28 lines
729 B
HTML
{{define "title"}}{{.note.Title}}{{end}}
|
|
{{define "main"}}
|
|
<div>
|
|
{{.note.BodyRendered}}
|
|
</div>
|
|
<div class="d-flex justify-content-between">
|
|
<a class="btn btn-primary" href="{{.urlEdit}}">Edit</a>
|
|
<a class="btn btn-danger" href="{{.urlDelete}}">Delete</a>
|
|
</div>
|
|
|
|
<script>
|
|
let checkBoxes = document.querySelectorAll('input[type=checkbox]')
|
|
for (const i in checkBoxes) {
|
|
let box = checkBoxes[i]
|
|
box.disabled = false
|
|
|
|
box.onchange = function(event) {
|
|
let form = new FormData()
|
|
form.append("box", i)
|
|
|
|
fetch("togglebox/", {method: "POST", body: form}).then((response) => {
|
|
location.reload();
|
|
})
|
|
}
|
|
}
|
|
|
|
</script>
|
|
{{end}}
|