BrainMinder/assets/templates/notebooks/list.tmpl

58 lines
1.9 KiB
Cheetah
Raw Normal View History

2024-08-22 10:13:16 +02:00
{{define "notebooks:list"}}
<div
id="all_types_search"
class="w3-panel w3-border w3-round-large w3-display-container"
style="display: none"
>
<form
class="w3-container"
method="POST"
hx-post="/notebooks"
hx-target="#notebooks"
>
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}" />
<div class="w3-row">
<div class="w3-half" style="padding-right: 4px">
<label for="notebook-title">Title</label>
<input
name="Title"
2024-11-17 20:12:20 +01:00
class=" w3-border"
2024-08-22 10:13:16 +02:00
id="notebook-title"
type="text"
value=""
/>
</div>
</div>
<div class="w3-bar" style="padding-top: 8px; padding-bottom: 8px">
<button type="submit" class="w3-btn w3-metro-dark-blue w3-round-large">
<i class="bi bi-search"></i> Find
</button>
</div>
</form>
</div>
2024-12-08 21:07:22 +01:00
<div id="notebooks">
<table class="table-all striped">
2024-08-22 10:13:16 +02:00
<thead>
<tr>
<th>Title</th>
2024-12-08 21:07:22 +01:00
<th class="operations">
<a class="button" hx-get="/notebook/create" hx-push-url="true" hx-target="#page-content"><i class="bi bi-plus-circle"></i></a>
<a class="button" href="#" _="on click toggle the *display of #all_types_search"><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 .notebooks }}
2024-08-22 10:13:16 +02:00
<tr>
2024-12-08 21:07:22 +01:00
<td class="title" data-label="Title"><i class="{{.Icon}}"></i> {{.Title}}</td>
<td class="operations">
<button hx-get="/notebook/update/{{.Id}}" hx-push-url="true" hx-target="#page-content"><i class="bi bi-pencil"></i></button>
<button hx-delete="/notebook/delete/{{.Id}}" hx-target="closest tr" hx-swap="outerHTML swap:1s" hx-trigger="confirmed" onClick="bm_show_confirm(this, 'Notebooks', 'Delete this notebook ?')"><i class="bi bi-trash"></i></button>
2024-08-22 10:13:16 +02:00
</td>
</tr>
2024-12-08 21:07:22 +01:00
{{ end }}
2024-08-22 10:13:16 +02:00
</tbody>
</table>
</div>
{{ end }}