numerus/web/template/payments/accounts/edit.gohtml

43 lines
1.6 KiB
Plaintext
Raw Normal View History

{{ define "title" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentAccountForm*/ -}}
{{ printf ( pgettext "Edit Payment Account “%s”" "title" ) .Name }}
{{- end }}
{{ define "breadcrumbs" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentAccountForm*/ -}}
<nav data-hx-target="main" data-hx-boost="true">
<p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a href="{{ companyURI "/payment-accounts"}}">{{( pgettext "Payment Accounts" "title" )}}</a> /
<a>{{ .Name }}</a>
</p>
</nav>
{{- end }}
{{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentAccountForm*/ -}}
<section data-hx-target="main">
<h2>{{ template "title" . }}</h2>
<form method="POST" action="{{ companyURI "/payment-accounts/" }}{{ .Slug }}"
data-hx-swap="innerHTML show:false"
data-hx-boost="true"
>
{{ csrfToken }}
{{ putMethod }}
<input type="hidden" name="{{ .Type.Name }}" value="{{ .Type.Selected }}">
{{ template "input-field" .Name }}
{{ if eq .Type.Selected "bank" }}
{{ template "input-field" .IBAN }}
{{ else if eq .Type.Selected "card" }}
{{ template "input-field" .LastFourDigits }}
{{ template "input-field" .ExpirationMonthYear }}
{{ end }}
<footer>
<button class="primary" type="submit">{{( pgettext "Update" "action" )}}</button>
</footer>
</form>
</section>
{{- end }}