BrainMinder/assets/templates/items/read.tmpl

55 lines
2.0 KiB
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "page:content"}}
<div id="item">
<div class="w3-container page-container">
<h5 class="title">{{ .item.Title }}</h5>
{{ if gt (len .item.Summary) 0}}
<div class="w3-round-large summary">
{{.item.Summary_rendered | safeHTML}}
</div>
{{ end }}
{{.item.Description_rendered | safeHTML}}
{{ if gt (len .fields) 0}}
2024-11-17 20:12:20 +01:00
<ul class="fields">
2024-08-22 10:13:16 +02:00
{{ range .fields }}
<li><span style="font-weight: bold;">{{.Title}}</span> : {{ renderFieldValue .Value .Widget}}</li>
{{ end }}
</ul>
{{ end }}
{{ template "item:relations_view" .}}
2024-11-21 18:14:12 +01:00
<div class="row">
<div class="half">
2024-08-22 10:13:16 +02:00
{{if gt (len .item.Categories) 0 }}
2024-11-10 20:52:32 +01:00
<i class="hide-medium hide-large bi bi-tags-fill"></i>
<strong class="hide-small">Categories</strong>
2024-08-22 10:13:16 +02:00
{{ range (stringToArray .item.Categories "|")}}
{{ $category_name := index $.categoriesMap .}}
<div class="tag" style="padding: 3px">
2024-12-08 21:07:22 +01:00
<a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{&quot;category_id&quot; : &quot;{{ . }}&quot;}">{{ $category_name }}</a>
2024-08-22 10:13:16 +02:00
</div>
{{ end }}
{{ end }}
</div>
2024-11-21 18:14:12 +01:00
<div class="half">
2024-08-22 10:13:16 +02:00
{{if gt (len .item.Tags) 0 }}
2024-11-10 20:52:32 +01:00
<i class="hide-medium hide-large bi bi-tags"></i>
<strong class="hide-small">Tags</strong> {{ range (stringToArray .item.Tags ",")}}
2024-08-22 10:13:16 +02:00
<div class="tag" style="padding: 3px">
2024-12-08 21:07:22 +01:00
<a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{&quot;Tags&quot; : &quot;{{.}}&quot;}">{{ . }}</a>
2024-08-22 10:13:16 +02:00
</div>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>
2024-12-11 17:52:09 +01:00
<div id="footer-navbar">
2024-12-08 21:07:22 +01:00
<a class="button main" hx-get="/item/update/{{.item.Id}}" hx-push-url="true" hx-target="#page-content" title="Edit" href="/item/update/{{.item.Id}}"><i class="bi bi-pencil"></i></a>
<a class="button main" hx-get="/item/share/{{.item.Id}}" hx-target="#modal-container" title="Share" href="#"><i class='bi bi-share-fill'></i></a>
2024-12-11 17:52:09 +01:00
</div>
2024-08-22 10:13:16 +02:00
{{ end }}