BrainMinder/assets/templates/categories/list.tmpl
2025-01-01 17:44:54 +01:00

42 lines
1.7 KiB
Cheetah

{{define "categories:list"}}
<div id="all_categories_search" hidden>
<div class="panel-search">
<form method="POST" hx-post="/categories" hx-target="#categories">
<div class="row">
<div class="col half" style="padding-right: 4px">
<label for="category-name">Name</label>
<input name="Name" id="category-name" type="text" value=""/>
</div>
</div>
<div class="bar" style="padding-top: 8px; padding-bottom: 8px"><button type="submit" class="main"><i class="bi bi-search"></i> Find</button></div>
</form>
</div>
</div>
<div id="categories" class="list">
<table class="table-all striped">
<thead>
<tr>
<th>Name</th>
<th class="operations">
<a class="button show-large" hx-get="/category/create" hx-push-url="true" hx-target="#page-content"><i class="bi bi-plus-circle"></i></a>
<a class="button show-large" href="#" onclick="bm_toggle_visibility_list_search('all_categories_search'); return false;"><i class="bi bi-search"></i></a>
</th>
</tr>
</thead>
<tbody>
{{ range .categories }}
<tr>
<td class="title" data-label="Name">{{.Name}}
</td>
<td data-label="" class="operations">
<button hx-get="/category/update/{{.Id}}" hx-push-url="true" hx-target="#page-content"><i class="bi bi-pencil"></i></button>
<button hx-delete="/category/delete/{{.Id}}" hx-target="closest tr" hx-swap="outerHTML swap:1s" hx-trigger="confirmed" onClick="bm_show_confirm_delete(this, 'Categories', 'Delete this category ?')"><i class="bi bi-trash"></i>
</button>
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
{{ end }}