BrainMinder/assets/templates/items/read.tmpl

103 lines
2.8 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">
<a
hx-post="/items"
hx-target="#page-content"
hx-push-url="true"
href="#"
hx-vals="{&quot;category_id&quot; : &quot;{{ . }}&quot;}"
>{{ $category_name }}</a
>
</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">
<a
hx-post="/items"
hx-target="#page-content"
hx-push-url="true"
href="#"
hx-vals="{&quot;Tags&quot; : &quot;{{.}}&quot;}"
>{{ . }}</a
>
</div>
{{ end }}
{{ end }}
</div>
</div>
<a
2024-11-21 18:14:12 +01:00
class="button main hide-small"
2024-08-22 10:13:16 +02:00
hx-get="/item/update/{{.item.Id}}"
hx-push-url="true"
hx-target="#page-content"
href="#"
><i class="bi bi-pencil"></i> Edit</a
>
<a
2024-11-21 18:14:12 +01:00
class="button main hide-small"
2024-08-22 10:13:16 +02:00
href="#"
hx-target="#modal-container"
hx-get="/item/share/{{.item.Id}}"
title="Share"
><i class='bi bi-share-fill'></i> Share</a>
</div>
</div>
<div class="footerNavbar-container">
2024-11-10 20:52:32 +01:00
<div class="w3-bar footerNavbar hide-medium hide-large w3-round-large">
2024-08-22 10:13:16 +02:00
<div class="w3-bar-item">
<a
class="w3-btn w3-metro-dark-blue "
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>
</div>
<div class="w3-bar-item">
<a
class="w3-btn w3-metro-dark-blue "
hx-get="/item/share/{{.item.Id}}"
hx-target="#modal-container"
title="Share"
href="#"><i class='bi bi-share-fill'></i>
</a>
</div>
</div>
</div>
{{ end }}