mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 05:36:49 +00:00
34 lines
1 KiB
Text
34 lines
1 KiB
Text
package view
|
|
|
|
templ LineItem(item *ItemViewModel) {
|
|
<tr>
|
|
<td>{ item.Item }</td>
|
|
<td>{ item.Quantity }</td>
|
|
<td>{ item.Price }</td>
|
|
<td>{ item.PaymentMethod }</td>
|
|
<td>{ item.PaymentStatus }</td>
|
|
<td>{ item.SubTotal }</td>
|
|
<td>
|
|
<button class="secondary" hx-get={ item.ItemUrl } hx-target="closest tr" hx-swap="outerHTML">Edit</button>
|
|
if item.PaymentStatus != "Completed" {
|
|
<button class="secondary" hx-post={ item.ItemUrl } hx-target="closest tr" hx-swap="outerHTML">Paid</button>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
templ LineItemForm(item *ItemViewModel) {
|
|
<tr>
|
|
<form hx-put={ item.ItemUrl }>
|
|
<td><input value={ item.Item } name="item"/></td>
|
|
<td><input value={ item.Quantity } name="quantity"/></td>
|
|
<td><input value={ item.Price } name="price"/></td>
|
|
<td><input value={ item.PaymentMethod } name="paymentMethod"/></td>
|
|
<td><input value={ item.PaymentStatus } name="PaymentStatus"/></td>
|
|
<td>{ item.SubTotal }</td>
|
|
<td>
|
|
<button class="secondary">Save</button>
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
}
|