numerus/web/template/payments/edit.gohtml

60 lines
2.3 KiB
Plaintext
Raw Normal View History

{{ define "title" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentForm*/ -}}
{{- if eq .Type.Value "P" -}}
{{ printf ( pgettext "Edit Payment “%s”" "title" ) .Description }}
{{- else -}}
{{ printf ( pgettext "Edit Collection “%s”" "title" ) .Description }}
{{- end -}}
{{- end }}
{{ define "breadcrumbs" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentForm*/ -}}
<nav data-hx-target="main" data-hx-boost="true">
<p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
{{ if .Expense }}
<a href="{{ companyURI "/expenses" }}">{{( pgettext "Expenses" "title" )}}</a> /
<a href="{{ companyURI "/expenses/" }}{{ .Expense.Slug }}">{{ .Expense.InvoiceNumber }}</a> /
{{ else if .Invoice }}
<a href="{{ companyURI "/invoices" }}">{{( pgettext "Invoices" "title" )}}</a> /
<a href="{{ companyURI "/invoices/" }}{{ .Invoice.Slug }}">{{ .Invoice.InvoiceNumber }}</a> /
{{ end }}
<a href="{{ .BaseURI }}">
{{- if .Invoice -}}
{{( pgettext "Collections" "title" )}}
{{- else -}}
{{( pgettext "Payments" "title" )}}
{{- end -}}
</a> /
<a>{{ .Description }}</a>
</p>
</nav>
{{- end }}
{{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentForm*/ -}}
<section data-hx-target="main">
<h2>{{ template "title" . }}</h2>
<form method="POST" action="{{ .BaseURI }}/{{ .Slug }}"
2024-08-11 22:08:18 +00:00
enctype="multipart/form-data"
data-hx-swap="innerHTML show:false"
data-hx-boost="true"
>
{{ csrfToken }}
{{ putMethod }}
{{ template "hidden-select-field" .Type }}
{{ template "select-field" .PaymentAccount }}
{{ template "input-field" .Description }}
{{ template "input-field" .PaymentDate }}
{{ template "input-field" .Amount }}
{{ template "tags-field" .Tags }}
2024-08-11 22:08:18 +00:00
{{ template "file-field" .File }}
<footer>
<button class="primary" type="submit">{{( pgettext "Update" "action" )}}</button>
</footer>
</form>
</section>
{{- end }}