camper/web/templates/admin/booking/payment.gohtml

66 lines
2.6 KiB
Plaintext

<!--
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
SPDX-License-Identifier: AGPL-3.0-only
-->
{{ define "title" -}}
{{( pgettext "Payment Settings" "title" )}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.paymentForm*/ -}}
<form data-hx-put="/admin/booking/payment">
<h2>{{( pgettext "Payment Settings" "title" )}}</h2>
{{ CSRFInput }}
<fieldset>
{{ with .MerchantCode -}}
<label>
{{( pgettext "Merchant Code" "input")}}<br>
<input type="text" name="{{ .Name }}" value="{{ .Val }}"
required minlength="9"
{{ template "error-attrs" . }}><br>
</label>
{{ template "error-message" . }}
{{- end }}
{{ with .TerminalNumber -}}
<label>
{{( pgettext "Terminal Number" "input")}}<br>
<input type="number" name="{{ .Name }}" value="{{ .Val }}"
min="1" max="999"
required {{ template "error-attrs" . }}><br>
</label>
{{ template "error-message" . }}
{{- end }}
{{ with .EncryptKey -}}
<label>
{{ if $.MerchantCode.Val -}}
{{( pgettext "Merchant Key (only if must change it)" "input")}}<br>
{{- else -}}
{{( pgettext "Merchant Key" "input")}}<br>
{{- end }}
<input type="text" name="{{ .Name }}" value="{{ .Val }}"
{{ if not $.MerchantCode.Val }}required{{end }}
{{ template "error-attrs" . }}><br>
</label>
{{ template "error-message" . }}
{{- end }}
{{ with .Environment -}}
<fieldset>
<legend>{{( pgettext "Environment" "title")}}</legend>
{{ template "radio-options" . }}
</fieldset>
{{ template "error-message" . }}
{{- end }}
{{ with .Integration -}}
<fieldset>
<legend>{{( pgettext "Integration" "title")}}</legend>
{{ template "radio-options" . }}
</fieldset>
{{ template "error-message" . }}
{{- end }}
</fieldset>
<footer>
<button type="submit">{{( pgettext "Save changes" "action" )}}</button>
</footer>
</form>
{{- end }}