Move down HTMx attributes for booking form

Otherwise, it reloads the form while customers are writing their
details, removing the focus from the form; **very** annoying.

On the plus side, there is nothing to compute when entering these
fields, thus no redundant work is done now.
This commit is contained in:
jordi fita mas 2024-02-13 05:59:07 +01:00
parent 95ae50c1c3
commit 0f76351ae9
1 changed files with 14 additions and 9 deletions

View File

@ -5,13 +5,12 @@
-->
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.publicPage*/ -}}
{{ with .Form -}}
<fieldset
data-hx-get="/{{ currentLocale }}/booking"
data-hx-trigger="change"
>
<fieldset>
<input type="hidden" name="{{ .PaymentSlug.Name }}" value="{{ .PaymentSlug.Val }}">
<fieldset class="accommodation">
<fieldset class="accommodation"
data-hx-get="/{{ currentLocale }}/booking" data-hx-trigger="change"
>
<legend>{{( pgettext "Accommodation" "title" )}}</legend>
{{ range .CampsiteType.Options -}}
<label><input type="radio" name="{{ $.Form.CampsiteType.Name }}" value="{{ .Value }}"
@ -21,7 +20,9 @@
{{ template "error-message" .CampsiteType }}
</fieldset>
{{ with .Dates -}}
<fieldset class="booking-period">
<fieldset class="booking-period"
data-hx-get="/{{ currentLocale }}/booking" data-hx-trigger="change"
>
<legend>{{( pgettext "Booking Period" "title" )}}</legend>
{{ with .ArrivalDate -}}
<label>
@ -48,7 +49,9 @@
</fieldset>
{{- end }}
{{ with $guests := .Guests -}}
<fieldset class="guests campsite-options">
<fieldset class="guests campsite-options"
data-hx-get="/{{ currentLocale }}/booking" data-hx-trigger="change"
>
<legend>{{( pgettext "Guests" "title" )}}</legend>
{{ with .NumberAdults -}}
@ -107,7 +110,9 @@
</fieldset>
{{- end }}
{{ with .Options -}}
<fieldset class="campsite-options">
<fieldset class="campsite-options"
data-hx-get="/{{ currentLocale }}/booking" data-hx-trigger="change"
>
<legend>{{ .Legend }}</legend>
{{ with .ZonePreferences -}}
<label>