<!--
 SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
 SPDX-FileCopyrightText: 2023 Oriol Carbonell <info@oriolcarbonell.cat>
 SPDX-License-Identifier: AGPL-3.0-only
-->
{{ define "title" -}}
    {{( pgettext "Booking" "title" )}}
{{- end }}

{{ define "head" -}}
    <script src="/static/idiomorph-ext@0.3.0.min.js"></script>
{{- end }}

{{ define "content" -}}
    {{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.publicPage*/ -}}
    <h2>{{ template "title" . }}</h2>
    {{ if .HasErrors -}}
        <div role="alert" class="error">
            <p>{{( gettext "Sorry, there was a problem. You’ll find more details highlighted below." )}}</p>
        </div>
    {{- end }}
    {{ if eq .Environment "test" }}
        <div role="alert" class="warning">
            <p>{{( gettext "Payment is in test mode. You can make the booking regardless, but no money will be charged. We will send you an additional email with instructions on how to perform the payment." )}}</p>
        </div>
    {{- end }}
    <form id="booking" action="/{{ currentLocale }}/booking" method="post"
          data-hx-ext="morph"
          data-hx-swap="morph:innerHTML"
          data-hx-include="this"
          data-hx-target="this"
          data-hx-replace-url="true"
    >
        {{ template "fields.gohtml" . }}
    </form>
{{- end }}
