Go to file
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
cmd/camper Manage all media uploads in a single place 2023-09-21 01:56:44 +02:00
debian Tag database with v2 2024-01-29 02:52:52 +01:00
demo Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00
deploy Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00
pkg Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
po Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
revert Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00
test Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00
verify Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00
web Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
.gitignore Add the sample campsite types to the demo file 2023-09-10 03:57:46 +02:00
Makefile Add a controlled layer group for the zones on the map 2024-01-31 15:12:11 +01:00
go.mod Copy RecordArray from pgtype to database 2023-09-12 21:58:30 +02:00
go.sum Copy RecordArray from pgtype to database 2023-09-12 21:58:30 +02:00
guix.scm Add Guix package definition 2024-01-28 18:12:38 +01:00
sqitch.conf Add empty Sqitch configuration anq plan files 2023-07-20 23:43:23 +02:00
sqitch.plan Compute and show the “cart” for the booking form 2024-02-04 06:37:25 +01:00