rentease/internal/view/item_list.templ
2025-01-19 20:22:46 +01:00

35 lines
744 B
Text

package view
templ ItemList(itemList ItemListViewModel) {
<tbody id="line-items">
for _, item := range itemList.Items {
@LineItem(&item)
}
</tbody>
<thead>
<tr>
<th></th>
<th></th>
<th>Price (€)</th>
<th>Payment Method</th>
<th>Sub-total (€)</th>
<th></th>
</tr>
</thead>
<tbody>
if len(itemList.Payments) >0 {
for _,payment := range itemList.Payments {
<tr class="hover">
<td></td>
<td></td>
<td>- { payment.Amount }</td>
<td>{ payment.PaymentMethod }</td>
<td></td>
<td class="flex gap-2">
<button class="btn btn-sm btn-outline" hx-get={ payment.PaymentUrl } hx-target="closest tr" hx-swap="outerHTML">Edit</button>
</td>
</tr>
}
}
</tbody>
}