BrainMinder/assets/templates/categories/list.tmpl

42 lines
1.6 KiB
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "categories:list"}}
2024-12-27 17:33:16 +01:00
<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">
2024-08-22 10:13:16 +02:00
<label for="category-name">Name</label>
2024-12-27 17:33:16 +01:00
<input name="Name" id="category-name" type="text" value=""/>
2024-08-22 10:13:16 +02:00
</div>
</div>
2024-12-27 17:33:16 +01:00
<div class="bar" style="padding-top: 8px; padding-bottom: 8px"><button type="submit" class="main"><i class="bi bi-search"></i> Find</button></div>
2024-08-22 10:13:16 +02:00
</form>
2024-12-27 17:33:16 +01:00
</div>
2024-08-22 10:13:16 +02:00
</div>
2024-12-08 21:07:22 +01:00
<div id="categories" class="list">
<table class="table-all striped">
2024-08-22 10:13:16 +02:00
<thead>
<tr>
<th>Name</th>
2024-12-08 21:07:22 +01:00
<th class="operations">
<a class="button" hx-get="/category/create" hx-push-url="true" hx-target="#page-content"><i class="bi bi-plus-circle"></i></a>
2024-12-27 17:33:16 +01:00
<a class="button" href="#" onclick="bm_toggle_visibility_list_search('all_categories_search'); return false;"><i class="bi bi-search"></i></a>
2024-08-22 10:13:16 +02:00
</th>
</tr>
</thead>
<tbody>
2024-12-08 21:07:22 +01:00
{{ range .categories }}
2024-08-22 10:13:16 +02:00
<tr>
2024-12-08 21:07:22 +01:00
<td class="title" data-label="Name">{{.Name}}
2024-08-22 10:13:16 +02:00
</td>
2024-12-08 21:07:22 +01:00
<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>
2024-12-13 17:56:43 +01:00
<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>
2024-08-22 10:13:16 +02:00
</button>
</td>
</tr>
2024-12-08 21:07:22 +01:00
{{ end }}
2024-08-22 10:13:16 +02:00
</tbody>
</table>
</div>
{{ end }}