2024-08-22 10:13:16 +02:00
|
|
|
{{define "home:items"}}
|
|
|
|
|
|
|
|
{{ $itemCount := 0 }}
|
|
|
|
|
|
|
|
{{ range.items }}
|
2024-11-21 18:14:12 +01:00
|
|
|
<div class="col l4 m6 s12 item" style="margin-bottom: 10px;"
|
2024-08-22 10:13:16 +02:00
|
|
|
{{ $itemCount = incr $itemCount}}
|
|
|
|
{{ if eq $itemCount 10 }}
|
|
|
|
{{ $offset := addI $.offset $itemCount}}
|
|
|
|
hx-get="/?offset={{ $offset }}&out=items"
|
|
|
|
hx-trigger="revealed"
|
|
|
|
hx-swap="afterend"
|
|
|
|
{{ end }}
|
|
|
|
>
|
2024-11-21 18:14:12 +01:00
|
|
|
<div class="item-card">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col l11 m11 s11">
|
2024-10-20 20:25:59 +02:00
|
|
|
<h5>
|
2024-11-10 20:52:32 +01:00
|
|
|
<a class="hide-small" href="/item/view/{{.Id}}" hx-get="/item/view/{{.Id}}" hx-target="#modal-container"><i class="{{.Type_icon}}" title="{{.Type_title}}"></i> {{.Title}}</a>
|
|
|
|
<a class="hide-medium hide-large" href="/item/read/{{.Id}}" hx-get="/item/read/{{.Id}}" hx-target="#page-content" hx-push-url="true"><i class="{{.Type_icon}}" title="{{.Type_title}}"></i> {{.Title}}</a>
|
2024-08-22 10:13:16 +02:00
|
|
|
</h5>
|
2024-10-20 20:25:59 +02:00
|
|
|
<div class="home-card-summary">{{.Summary | markdownfy | safeHTML}}</div>
|
2024-08-22 10:13:16 +02:00
|
|
|
</div>
|
2024-11-21 18:14:12 +01:00
|
|
|
<div class="col l1 m1 s1">
|
2024-08-22 10:13:16 +02:00
|
|
|
<a
|
|
|
|
class="w3-btn w3-medium w3-round-large"
|
|
|
|
style="float: right; padding: 8px 8px"
|
|
|
|
hx-get="/item/update/{{.Id}}"
|
|
|
|
hx-push-url="true"
|
|
|
|
hx-target="#page-content"
|
|
|
|
href="/item/update/{{.Id}}"
|
|
|
|
title="Edit"><i class="bi bi-pencil"></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a
|
|
|
|
class="w3-btn w3-medium w3-round-large"
|
|
|
|
style="float: right; padding: 8px 8px"
|
|
|
|
href="#"
|
|
|
|
hx-target="#modal-container"
|
|
|
|
hx-get="/item/share/{{.Id}}"
|
|
|
|
title="Share"><i class="bi bi-share-fill"></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a
|
|
|
|
class="w3-btn w3-medium w3-round-large"
|
|
|
|
style="float: right; padding: 8px 8px"
|
|
|
|
href="#"
|
|
|
|
hx-delete="/item/remove-from-dashboard/{{.Id}}"
|
|
|
|
hx-target="closest .item"
|
|
|
|
hx-swap="outerHTML swap:1s"
|
|
|
|
hx-trigger="confirmed"
|
|
|
|
onClick="bm_show_confirm(this, 'Dashboard', 'Remove this item from the dashboard ?')"
|
|
|
|
title="Remove from dashboard"> <i class="bi bi-pin"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ end }}
|