numerus/web/template/company/payment_methods.gohtml

69 lines
2.7 KiB
Plaintext
Raw Normal View History

{{ define "title" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentMethodsPage*/ -}}
{{( pgettext "Payment Methods" "title" )}}
{{- end }}
{{ define "breadcrumbs" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentMethodsPage*/ -}}
<nav data-hx-target="main" data-hx-boost="true">
<p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a>{{ template "title" . }}</a>
</p>
</nav>
{{- end }}
{{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentMethodsPage*/ -}}
<section data-hx-target="main" data-hx-swap="innerHTML show:false">
<h2>{{ template "title" . }}</h2>
<table>
<thead>
<tr>
<th>{{( pgettext "Payment Method" "title" )}}</th>
<th>{{( pgettext "Instructions" "title" )}}</th>
<th></th>
</tr>
</thead>
{{ $confirm := ( gettext "Are you sure?" )}}
<tbody data-hx-confirm="{{ $confirm }}" data-hx-target="closest tr" data-hx-swap="outerHTML swap:1s">
{{ with .PaymentMethods }}
{{- range $method := . }}
<tr>
<td>{{ .Name }}</td>
<td>{{ .Instructions }}</td>
<td>
<form method="POST" action="{{ companyURI "/payment-methods"}}/{{ .Id }}"
data-hx-boost="true">
{{ csrfToken }}
{{ deleteMethod }}
<button class="icon" aria-label="{{( gettext "Delete payment method" )}}"
><i class="ri-delete-back-2-line"></i></button>
</form>
</td>
</tr>
{{- end }}
{{ else }}
<tr>
<td colspan="3">{{( gettext "No payment methods added yet." )}}</td>
</tr>
{{ end }}
</tbody>
</table>
<form method="POST" action="{{ companyURI "/payment-methods" }}" data-hx-boost="true">
<h3>{{( pgettext "New Payment Method" "title")}}</h3>
<fieldset>
{{ csrfToken }}
{{ with .Form -}}
{{ template "input-field" .Name }}
{{ template "input-field" .Instructions }}
{{- end }}
</fieldset>
<footer>
<button>{{( pgettext "Add new payment method" "action" )}}</button>
</footer>
</form>
</section>
{{- end }}