BrainMinder/assets/templates/quickbox/list.tmpl

19 lines
923 B
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "quickbox:list"}}
{{ $rowCount := 0 }}
{{ range .quicknotes}}
2024-12-03 17:55:25 +01:00
<div id="quicknote-{{.Id}}" class="quickbox-row"
2024-08-22 10:13:16 +02:00
{{ $rowCount = incr $rowCount}}
{{ if eq $rowCount 10 }}
{{ $offset := addI $.offset $rowCount}}
{{ if gt $offset -1 }}
2024-12-13 17:56:43 +01:00
hx-get="/quickbox/all?offset={{ $offset }}" hx-trigger="intersect once" hx-swap="afterbegin" hx-target="#quickbox-notes"
2024-08-22 10:13:16 +02:00
{{ end }}
{{ end }}>
2024-12-03 17:55:25 +01:00
<div class="buttons">
2024-12-13 17:56:43 +01:00
<button class="button" hx-delete="/quickbox/delete/{{.Id}}" hx-target="closest div.quickbox-row" hx-swap="outerHTML swap:1s" hx-trigger='confirmed' onClick="bm_show_confirm_delete(this, 'Quickbox', 'Delete this note ?')"><i class="bi bi-dash-square"></i></button>
2024-12-16 17:55:33 +01:00
<button class="button" hx-target="body" hx-swap="beforeend" hx-get="/quickbox/transform/{{.Id}}"><i class='bi bi-arrow-up-left-circle-fill'></i></button>
2024-08-22 10:13:16 +02:00
</div>
2024-12-03 17:55:25 +01:00
<div class="note">{{.Note_rendered | safeHTML}}</div>
2024-08-22 10:13:16 +02:00
</div>
{{ end }}
{{ end }}