camper/pkg/form
jordi fita mas e5023a2a41 Handle the booking cart entirely with HTMx
Besides the dynamic final cart, that was already handled by HTMx, i had
to check the maximum number of guests, whether the accommodation allows
“overflow”, whether dogs are allowed, and that the booking dates were
within the campground’s opening and closing dates.

I could do all of this with AlpineJS, but then i would have to add the
same validation to the backend, prior to accept the payment.  Would not
make more sense to have them in a single place, namely the backend? With
HTMx i can do that.

However, i now have to create the form “piecemeal”, because i may not
have the whole information when the visitor arrives to the booking page,
and i still had the same problem as in commit d2858302efa—parsing the
whole form as is would leave guests and options field empty, rather than
at their minimum values.

One of the fieldsets in that booking form are the arrival and departure
dates, that are the sames we use in the campsite type’s page to
“preselect” these values.  Since now are in a separate struct, i can
reuse the same type and validation logic for both pages, making my
JavaScript code useless, but requiring HTMx.  I think this is a good
tradeoff, in fact.
2024-02-10 03:49:44 +01:00
..
checkbox.go Add the Active field to the campsite type’s edit form and function 2023-08-14 11:43:58 +02:00
file.go Add cover media to campsite types 2023-09-10 03:04:18 +02:00
handle.go Add the edit form for services 2023-09-25 20:10:33 +02:00
input.go Handle null strings in I18nInput.FillArray 2024-01-26 22:31:11 +01:00
media.go Manage all media uploads in a single place 2023-09-21 01:56:44 +02:00
select.go Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
validator.go Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00