feat: Some updates to employee views.

This commit is contained in:
2025-01-10 23:32:36 -05:00
parent 69351d0a0b
commit 9994644d21
4 changed files with 79 additions and 99 deletions

View File

@@ -0,0 +1,40 @@
<tr id="employee_#(id)">
<td>#capitalized(firstName) #capitalized(lastName)</td>
<td style="width: 10%; text-align: center;">
#if(active):
<a class="toggle"
hx-patch="/employees/#(id)/toggle-active"
hx-target="#employee_#(id)"
hx-swap="outerHTML"
>
<img src="images/toggle-on.svg" alt="Active">
</a>
#else:
<a class="toggle"
hx-patch="/employees/#(id)/toggle-active"
hx-target="#employee_#(id)"
hx-swap="outerHTML"
>
<img src="images/toggle-off.svg" alt="Active">
</a>
#endif
</td>
<td style="width: 100px;">
<a class="btn btn-delete"
href="javascript:void(0)"
hx-delete="/employees/#(id)"
hx-target="#employee-table"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to delete this employee?"
>
#extend("img/trash-can")
</a>
<a class="btn btn-edit" hx-get="/employees/#(id)"
hx-target="#employee-form"
hx-on::after-request=" if(event.detail.successful) toggleContent('form')"
>
#extend("img/pencil")
</a>
</td>
</tr>