| 1 |
|
| 2 |
<div id="item-list" hx-target="this" hx-swap="outerHTML" hx-confirm="This will affect all selected items. Continue?"> |
| 3 |
|
| 4 |
<div class="toolbar" hx-include="#item-list [name='selected']"> |
| 5 |
<button hx-post="/items/archive" hx-disabled-elt="closest .toolbar"> |
| 6 |
Archive Selected |
| 7 |
</button> |
| 8 |
<button hx-delete="/items/bulk" |
| 9 |
hx-prompt="Type DELETE to confirm" |
| 10 |
hx-disabled-elt="closest .toolbar"> |
| 11 |
Delete Selected |
| 12 |
</button> |
| 13 |
</div> |
| 14 |
|
| 15 |
<table> |
| 16 |
<thead> |
| 17 |
<tr> |
| 18 |
<th><input type="checkbox" hx-on::click="toggleAll(this)"></th> |
| 19 |
<th hx-get="/items?sort=name" hx-swap="outerHTML scroll:#item-list:top">Name</th> |
| 20 |
<th hx-get="/items?sort=date" hx-swap="outerHTML scroll:#item-list:top">Date</th> |
| 21 |
</tr> |
| 22 |
</thead> |
| 23 |
<tbody id="item-rows"> |
| 24 |
<tr> |
| 25 |
<td><input type="checkbox" name="selected" value="1"></td> |
| 26 |
<td>Item 1</td> |
| 27 |
<td>2025-01-01</td> |
| 28 |
<td> |
| 29 |
<button hx-get="/items/1/edit" hx-target="closest tr" hx-swap="outerHTML"> |
| 30 |
Edit |
| 31 |
</button> |
| 32 |
</td> |
| 33 |
</tr> |
| 34 |
</tbody> |
| 35 |
</table> |
| 36 |
|
| 37 |
<div hx-get="/items?page=2" |
| 38 |
hx-trigger="revealed" |
| 39 |
hx-swap="outerHTML" |
| 40 |
hx-indicator="#load-more-spinner"> |
| 41 |
<img id="load-more-spinner" class="htmx-indicator" src="/spinner.gif"> |
| 42 |
Loading more... |
| 43 |
</div> |
| 44 |
</div> |