BrainMinder/assets/templates/items/view.tmpl

56 lines
2.1 KiB
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "page:content"}}
2024-12-11 17:52:09 +01:00
<dialog role="dialog" aria-modal="true" open>
<header>
<div style="float:left; max-width: 420px;">
<h5><i class="{{.item.Type_icon}}" title="{{.item.Type_title}}"></i> {{.item.Type_title}} : {{.item.Title}}</h5>
</div>
<div style="float:right">
<a class="button main close-dialog" hx-get="/item/update/{{.item.Id}}" hx-push-url="true" hx-target="#page-content" href="/item/update/{{.item.Id}}"><i class="bi bi-pencil close-dialog"></i></a>
<span class="close-dialog button close"><i class='close-dialog bi bi-x-circle-fill'></i></span>
</div>
</header>
2024-08-22 10:13:16 +02:00
2024-12-11 17:52:09 +01:00
<div class="content">
{{ if gt (len .item.Summary) 0}}
<span style="font-weight: bold;">Summary</span>
<div class="summary">
{{.item.Summary_rendered | safeHTML}}
</div>
{{ end }}
2024-08-22 10:13:16 +02:00
2024-12-11 17:52:09 +01:00
{{.item.Description_rendered | safeHTML}}
2024-08-22 10:13:16 +02:00
2024-12-11 17:52:09 +01:00
{{ if gt (len .fields) 0}}
<ul class="fields">
{{ range .fields }}
2024-08-22 10:13:16 +02:00
<li><span style="font-weight: bold;">{{.Title}}</span> : {{ renderFieldValue .Value .Widget}}</li>
{{ end }}
2024-12-11 17:52:09 +01:00
</ul>
{{ end }}
2024-08-22 10:13:16 +02:00
2024-12-11 17:52:09 +01:00
{{ template "item:relations_view" .}}
2024-08-22 10:13:16 +02:00
2024-11-21 18:14:12 +01:00
<div class="row" style="margin-bottom: 20px">
<div class="col half">
2024-08-22 10:13:16 +02:00
<strong>Categories</strong>
{{ range (stringToArray .item.Categories "|")}}
{{ $category_name := index $.categoriesMap .}}
<div class="tag" style="padding: 3px">
2024-11-29 17:56:53 +01:00
<a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{category_id&quot; : &quot;{{ . }}&quot;}">{{ $category_name }}</a>
2024-08-22 10:13:16 +02:00
</div>
{{ end }}
</div>
2024-11-21 18:14:12 +01:00
<div class="col half">
2024-08-22 10:13:16 +02:00
{{ if gt (len .item.Tags) 0 }}
<strong>Tags</strong> {{ range (stringToArray .item.Tags ",")}}
<div class="tag" style="padding: 3px">
2024-11-29 17:56:53 +01:00
<a hx-post="/items" hx-target="#page-content" hx-push-url="true" href="#" hx-vals="{Tags&quot; : &quot;{{.}}&quot;}">{{ . }}</a>
2024-08-22 10:13:16 +02:00
</div>
{{ end }}
{{ end }}
</div>
</div>
2024-12-11 17:52:09 +01:00
2024-08-22 10:13:16 +02:00
</div>
2024-12-11 17:52:09 +01:00
</dialog>
2024-08-22 10:13:16 +02:00
{{ end }}