BrainMinder/assets/templates/quickbox/list.tmpl

24 lines
1.1 KiB
Cheetah
Raw Permalink Normal View History

2024-08-22 10:13:16 +02:00
{{define "quickbox:list"}}
{{ $rowCount := 0 }}
{{ range .quicknotes}}
<div id="quicknote-{{.Id}}" class="w3-row w3-container w3-border w3-padding w3-round-large quickbox-row"
{{ $rowCount = incr $rowCount}}
{{ if eq $rowCount 10 }}
{{ $offset := addI $.offset $rowCount}}
{{ if gt $offset -1 }}
hx-get="/quickbox/all?offset={{ $offset }}"
hx-trigger="intersect once"
hx-swap="afterbegin"
hx-target="#quickbox-notes"
{{ end }}
{{ end }}>
<div class="w3-col w3-right buttons">
<button class="w3-button w3-delete w3-small w3-border w3-round-large" hx-delete="/quickbox/delete/{{.Id}}" hx-target="closest div.w3-row" hx-swap="outerHTML swap:1s" hx-trigger='confirmed'
onClick="bm_show_confirm(this, 'Quickbox', 'Delete this note ?')">
<i class="bi bi-dash-square"></i></button>
<button class="w3-button w3-edit w3-small w3-border w3-round-large" hx-target="#modal-container" hx-get="/quickbox/transform/{{.Id}}"><i class='bi bi-arrow-up-left-circle-fill'></i></button>
</div>
<div class="w3-rest">{{.Note_rendered | safeHTML}}</div>
</div>
{{ end }}
{{ end }}