mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
Some checks are pending
CI / checks (push) Waiting to run
- Add `APP_STRIPE_ACCOUNT_ID` to config and README. - Pass Stripe account ID to payment view models. - Show "View in Stripe" badge linking to the payment in Stripe dashboard for card payments when account ID and payment ID are present. - Update Makefile to run format/lint locally instead of in container. - Update templates and generated code to support new dashboard link.
75 lines
1.5 KiB
Text
75 lines
1.5 KiB
Text
package view
|
|
|
|
templ PaymentLine(payment *PaymentViewModel) {
|
|
<tr class="hover">
|
|
<td></td>
|
|
<td></td>
|
|
<td>- { payment.Amount }</td>
|
|
<td>
|
|
{ payment.PaymentMethod }
|
|
if payment.StripeDashboardURL != "" {
|
|
<a
|
|
href={ payment.StripeDashboardURL }
|
|
target="_blank"
|
|
rel="noreferrer noopener"
|
|
class="badge badge-outline badge-sm ml-2"
|
|
>
|
|
View in Stripe
|
|
</a>
|
|
}
|
|
</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>
|
|
}
|
|
|
|
templ PaymentForm(payment *PaymentViewModel) {
|
|
<tr class="hover">
|
|
<form hx-put={ payment.PaymentUrl } id="edit-payment" hx-target="closest tr" hx-swap="outerHTML">
|
|
<td></td>
|
|
<td></td>
|
|
<td>
|
|
<input
|
|
class="input input-bordered input-sm w-full"
|
|
type="number"
|
|
inputmode="decimal"
|
|
step="0.01"
|
|
value={ payment.Amount }
|
|
name="amount"
|
|
form="edit-payment"
|
|
/>
|
|
</td>
|
|
<td>
|
|
<input
|
|
class="input input-bordered input-sm w-full"
|
|
value={ payment.PaymentMethod }
|
|
name="paymentMethod"
|
|
form="edit-payment"
|
|
/>
|
|
</td>
|
|
<td></td>
|
|
<td>
|
|
<button class="btn btn-sm btn-primary" type="submit" form="edit-payment">Save</button>
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
}
|
|
|
|
templ PaymentList(payments []*PaymentViewModel) {
|
|
<tbody id="payment-lines">
|
|
if len(payments) >0 {
|
|
for _,payment := range payments {
|
|
@PaymentLine(payment)
|
|
}
|
|
}
|
|
</tbody>
|
|
}
|