BrainMinder/assets/templates/items/list.tmpl
2024-12-05 18:16:04 +01:00

74 lines
2.0 KiB
Cheetah

{{define "items:list"}}
<div
id="items_search"
class="hidden"
>
<div class="w3-border w3-round-large w3-display-container panel-search">
<form
class="w3-container"
method="POST"
hx-post="/items/type/{{.type.Id}}"
hx-target="#items"
>
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}" />
<div class="w3-row">
<div class="w3-third" style="padding-right: 4px">
<label for="item-title">Title</label>
<input
name="Title"
class=" w3-border"
id="item-title"
type="text"
value=""
/>
</div>
<div class="w3-third" style="padding-right: 4px">
<label for="item-title">Category</label>
<input
name="Category"
class=" w3-border"
id="item-category"
type="text"
value=""
/>
</div>
<div class="w3-third" style="padding-left: 4px">
<label for="item-tags">Tags</label>
<input
name="Tags"
class=" w3-border"
id="item-tags"
type="text"
value=""
/>
</div>
</div>
<div class="bar" style="padding-top: 8px; padding-bottom: 8px">
<button type="submit"><i class="bi bi-search"></i> Find</button>
</div>
</form>
</div>
</div>
<div id="items" class="list">
<table class="table-all responsive striped stickyheader">
<thead>
<tr>
<th>Title</th>
<th>Categories</th>
<th>Tags</th>
{{ range .Fields}}
<th>{{.Title}}</th>
{{end}}
<th class="operations" nowrap="nowrap">
<a class="button" hx-get="/item/create/{{.type.Id}}" hx-push-url="true" hx-target="#page-content"><i class="bi bi-plus-circle"></i></a>
<a class="button" href="#" onclick="bm_toggle_visibility_list_search('items_search'); return false;"><i class="bi bi-search"></i></a>
</th>
</tr>
</thead>
<tbody>
{{ template "items:list_rows" .}}
</tbody>
</table>
</div>
{{ end }}