feat: Some updates to employee views.
This commit is contained in:
40
Resources/Views/employees/table-row.leaf
Normal file
40
Resources/Views/employees/table-row.leaf
Normal 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>
|
||||
Reference in New Issue
Block a user