mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-10 12:46:53 +00:00
* use tailwind and daisyui * split the layout in multiple components * remove unused code * footer compoonent * login form log * booking table fd * cancel style * header * booking form * new booking * line items * line item * report * uniform headings
34 lines
1.5 KiB
Text
34 lines
1.5 KiB
Text
package view
|
|
|
|
templ LineItem(item *ItemViewModel) {
|
|
<tr class="hover">
|
|
<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 class="flex gap-2">
|
|
<button class="btn btn-sm btn-outline" hx-get={ item.ItemUrl } hx-target="closest tr" hx-swap="outerHTML">Edit</button>
|
|
if item.PaymentStatus != "Completed" {
|
|
<button class="btn btn-sm btn-success" hx-post={ item.ItemUrl } hx-target="closest tr" hx-swap="outerHTML">Paid</button>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
templ LineItemForm(item *ItemViewModel) {
|
|
<tr class="hover">
|
|
<form hx-put={ item.ItemUrl } id="edit-item" hx-target="closest tr" hx-swap="outerHTML">
|
|
<td><input class="input input-bordered input-sm w-full" value={ item.Item } name="item" form="edit-item"/></td>
|
|
<td><input class="input input-bordered input-sm w-full" value={ item.Quantity } name="quantity" form="edit-item"/></td>
|
|
<td><input class="input input-bordered input-sm w-full" value={ item.Price } name="price" form="edit-item"/></td>
|
|
<td><input class="input input-bordered input-sm w-full" value={ item.PaymentMethod } name="paymentMethod" form="edit-item"/></td>
|
|
<td><input class="input input-bordered input-sm w-full" value={ item.PaymentStatus } name="PaymentStatus" form="edit-item"/></td>
|
|
<td>{ item.SubTotal }</td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary" type="submit" form="edit-item">Save</button>
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
}
|