35 lines
840 B
Plaintext
35 lines
840 B
Plaintext
<table id="vendor-table">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Branches</th>
|
|
<th></th>
|
|
</tr>
|
|
<tbody id="vendor-table-body">
|
|
#for(vendor in vendors):
|
|
<tr id="vendor_#(vendor.id)">
|
|
<td>#capitalized(vendor.name)</td>
|
|
<td>
|
|
#if(vendor.branches):
|
|
<ul>
|
|
#for(branch in vendor.branches):
|
|
<li>#capitalized(branch.name)</li>
|
|
#endfor
|
|
</ul>
|
|
#endif
|
|
</td>
|
|
<!-- TODO: Add edit button -->
|
|
<td>
|
|
<a class="btn btn-delete"
|
|
hx-delete="/vendors/#(vendor.id)"
|
|
hx-target="closest tr"
|
|
hx-swap="outerHTML swap:0.5s"
|
|
hx-confirm="Are you sure you want to delete this vendor?"
|
|
>
|
|
<img src="images/trash-can.svg" alt="Delete">
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
#endfor
|
|
</tbody>
|
|
</table>
|