Commit Graph

87 Commits

Author SHA1 Message Date
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
oriol carbonell pujolàs d2560e8748 Reduce padding of footer’s highlighted section 2024-02-06 10:06:15 +01:00
oriol carbonell pujolàs 771f5077d4 Add bottom padding to campsite type’s title
This is to avoid having the carousel’s arrows overlap the title
2024-02-06 10:04:44 +01:00
oriol carbonell pujolàs 373a6e5b6d Increase font size of home’s links and all arrows 2024-02-06 10:04:12 +01:00
jordi fita mas 2c36e45663 Compute and show the “cart” for the booking form
I have to ask number and age ranges of hosts of guests for all campsite
types, not only those that have price options for adults, children, etc.
because i must compute the tourist tax for adults.  These numbers will
be used to generate de rows for guests when actually creating the
booking, which is not done already.

To satisfy the campsite types that do have a price per guest, not only
per night, i had to add the prices for each range in the
campsite_type_cost relation.  If a campsite type does not have price
per person, then that should be zero; the website then does not display
the price.

The minimal price for any campsite type is one adult for one night,
thus to compute the price i need at least the campsite type, the dates,
and the number of adults, that has a minimum of one.  I changed the
order of the form to ask for these values first, so i can compute the
initial price as soon as possible.  To help further, i show the
<fieldset>s progressively when visitors select options.
2024-02-04 06:37:25 +01:00
jordi fita mas cabab93aa9 Remove redundant overflow-x from body 2024-02-03 01:51:36 +01:00
jordi fita mas 1491e975c2 Better control of scroll snap for calendar months on mobile
It is not a problem in desktop, because there is no scroll bar, but in
mobile you can scroll with touch, and i need the months to snap to the
start for the next and previous buttons to work.
2024-02-03 01:32:07 +01:00
jordi fita mas 244cbeddac Avoid horizontal scroll due to slick’s right margin
I can use overflow for that in most sizes, but on mobile the buttons
are outside the overflow and are not visible, thus have to revert it
and then remove the right margin to avoid the extra space.  Since on
mobile we only show a single slide at a time, the lack of margin is not
noticeable.
2024-02-03 01:11:21 +01:00
jordi fita mas daf6326652 Change the footer to a single column in table, rather than on mobile
Otherwise, the four columns are very difficult to read, and cause
horizontal overflow.
2024-02-03 01:03:08 +01:00
jordi fita mas 593004d0c9 Remove redundant right margin form slick list on mobile 2024-02-03 00:33:24 +01:00
jordi fita mas 63e33fa253 Fix booking field inside campsite’s page on mobile 2024-02-03 00:29:37 +01:00
jordi fita mas 4c4b9d8d02 Make submenus collapsible on mobile too
Had to change the link to the current language version of the page by a
button, to prevent following a link when trying to expand the submenu.

At first i did this with an `onclick="return false"` bullshit, but the
link was the wrong thing to do here, and it was there only to satisfy
Google et al. They will have to with the links in head.

Also made the link and buttons larger to make it easier to hit them with
finger.
2024-02-03 00:16:29 +01:00
jordi fita mas 64d94b5f35 Align text in surroundings on mobile 2024-02-02 21:40:41 +01:00
jordi fita mas 43505fecbd Reduce outside activities’ h3 bottom margin on mobile 2024-02-02 21:37:56 +01:00
oriol carbonell pujolàs fcbbc5c22a Fix sizes of the campground map and its legend 2024-02-02 02:39:55 +01:00
oriol carbonell pujolàs 5e053034a5 Move carousel arrows out of the way on mobile
Carrousels have a first slide that is mostly text without any background color,
and on mobile the arrows looked like where “erasing” the text.
2024-02-02 02:38:31 +01:00
oriol carbonell pujolàs 0b93a4c989 Remove order from slick-list
It was there from when the carousel was a flex; no longer used
2024-02-02 02:37:53 +01:00
oriol carbonell pujolàs 91339bec8b Leave direction for home slides on mobile and increase bottom padding
The change to column was from when the button and the text were both on the slide,
but now it only made the text stick to the top, which is the reverse of what we
wanted, but had to increase the space between the text and the booking button.
2024-02-02 02:30:54 +01:00
oriol carbonell pujolàs 61dbe5cf38 Set top-most address in a column with mobile screens 2024-02-02 02:28:45 +01:00
oriol carbonell pujolàs 18adbac5c3 Remove sticky position from header with mobile screens
Too much vertical space used just for that, otherwise.
2024-02-02 02:27:23 +01:00
jordi fita mas 516a9d9be8 Fix the font-size of #campground_map
Leaflet assumes that 1rem = 16px, and sets its wrapper’s font size to
.75rem to get 12px.  However, in our CSS 1rem = 10px.
2024-01-31 15:13:35 +01:00
oriol carbonell pujolàs 33100a6149 Adjust accomodation on home to show seven in a grid 2024-01-29 19:43:07 +01:00
jordi fita mas e320636ce1 Replace <div>s in legend with more semantically meaningful elements 2024-01-29 14:02:31 +01:00
oriol carbonell pujolàs 72f9e25140 Add map legend 2024-01-29 13:42:24 +01:00
jordi fita mas e6ab3f2d09 Change campsite info row to columns on small screens 2024-01-26 22:57:22 +01:00
jordi fita mas c284230436 Add public pages for each individual accommodation
A small page with a brief description, carousel, and feature list of
each individual accommodation.

Most of the relations and functions for carousel and features are like
the ones for campsite types, but i had to use the accommodation’s label
to find them, because they do not have slugs; i did not even though
these would be public, and they already have a label, although not
unique for all companies, like UUID slugs are.
2024-01-26 22:27:54 +01:00
jordi fita mas f514f9132e Add ad management for surroundings
They only want a single ad (for now, i guess).
2024-01-23 14:53:15 +01:00
jordi fita mas aa64e2e6e5 Replace fieldset:nth-child(3) with fieldset.campsite-options
Previously, the only type with options was plots, that was always the
third fieldset, which was the wrong thing to hardcode, but it was done
in a hurry.  Now there are more types with options, so we have to do it
properly.
2024-01-22 03:57:11 +01:00
oriol carbonell pujolàs 0431532ad5 Update styles 2024-01-18 03:27:07 +01:00
jordi fita mas c69c715ef3 Add position relative, and reduce margin of hero
Without the position relative, the booking button is no longer on top
of the carousel depending on the screen resolution, and Oriol wants less
gap between the carrousel and the next section.
2024-01-17 17:54:05 +01:00
jordi fita mas 25308a3359 Move carousel arrows inside the carousel, in the top-right
I misunderstood Oriol, and what he really wanted was to have the arrows
on top of the image, not just move the arrows from below to above. Thus,
I no longer need the carrousel to be a flex because the buttons are now
absolutely position (slick.css already sets the container to relative
position).

These arrows need to be visually inside a single container, to have a
white background, but Slick adds the two arrows separately.  I had to
move them close together, remove the radius from the “common edge”, and
use padding to “move” the arrows, rather than translation, in order to
avoid showing a gap.
2024-01-17 17:51:02 +01:00
jordi fita mas 962996be0b Clean up a bit the credit card div from booking page 2024-01-17 13:40:32 +01:00
oriol carbonell pujolàs 10e89c16df Add credit card logos to booking page 2024-01-17 13:31:33 +01:00
jordi fita mas 76d94f76f0 Change cover’s carousel to slick, and move arrows of all to top-right
Oriol did not like that this carousel was different from the rest, and
wanted to have it like the rest, but showing only one slide at a time,
like the customer wants.

He also wanted the arrows for **all** carousels to be in the top-right
corner instead of bottom-right, mostly because the customer complains
that she does not see the arrows if they are on the bottom, and Oriol
does not like the arrows to the sides.
2024-01-17 13:22:47 +01:00
jordi fita mas b1e3f5017f Add home’s cover carousel
This is a separate carousel from the one displayed at the bottom with
location info; it is, i suppose, a carousel for the hero image.

For the database, it works exactly as the home carousel, but on the
front had to use AlpineJS instead of Slick because it needs to show a
text popping up from the bottom when the slide is show, something i do
not know how to do in Slick.

It now makes no sense to have the carousel inside the “nature” section,
because the heading is no longer in there, and moved it out into a new
“hero” div.

Since i now have two carousels in home, i had to add additional
attributes to carousel.AdminHandler to know which URL to point to when
POSTing, PUTting, or redirecting.
2024-01-16 21:05:52 +01:00
jordi fita mas 0928e78bed Added copyright statement to files modified by Oriol 2024-01-16 17:58:49 +01:00
jordi fita mas a0f9c10193 Add management of surroundings’ highlights (points of interest)
Customer does not want the new “masonry-like” design of the surroundings
page, and wants the same style they already had: a regular list with
text and photo, alternating the photo’s side.

And, of course, they want to be able to add and edit them themselves. It
is like another carousel, but with an additional rich-text description.

The photos that we had in that page are no longer of use.
2024-01-16 01:26:35 +01:00
oriol carbonell pujolàs cd43fd3cfd Update public style 2024-01-15 12:32:52 +01:00
jordi fita mas 46e73abdd9 Remove an invalid max-width for the camping-association img 2024-01-15 02:07:56 +01:00
jordi fita mas 0ed6c1b121 Added note about dogs to the campsite type page
The pets icon is just the same as the notpet but without the diagonal
bar.

The price is hardcoded in the query for now, as there is no field
in the campsite type.
2024-01-15 02:07:32 +01:00
jordi fita mas 0beb0bb315 Add VAT and tourist tax information
Since i need the number of decimals to format the price in the template,
i added them to the company, and used them in the call to price_parse().
2024-01-15 01:45:58 +01:00
jordi fita mas 76456aa9b2 Add check-in and check-out time information to campsite type’s page 2024-01-15 01:02:50 +01:00
jordi fita mas 81b6edbc7b Show campground map using leaflet
It is better for mobile users, as they can zoom and pan the map in their
small screens.

Had to increase header’s z-index or the zoom controls would be on top
of it.
2024-01-14 22:31:13 +01:00
oriol carbonell pujolàs cb97151264 Update campground map 2024-01-14 21:36:03 +01:00
oriol carbonell pujolàs 6a2158e179 Update style 2024-01-13 01:20:31 +01:00
jordi fita mas 3f46ea3a9a Add “Menu” next to the trigram symbol (“hamburger”) 2024-01-10 19:41:57 +01:00
jordi fita mas 07223f64d2 Merge remote-tracking branch 'origin/upcoming' 2023-12-22 10:41:59 +01:00
oriol carbonell pujolàs a5c35c8da3 Add color to booking link and fix footer image sizes 2023-12-22 10:41:02 +01:00
jordi fita mas 4d0123def7 Bring back the whole list of options in type page, but in accordion
This is how the customer wants it.
2023-12-22 03:27:49 +01:00
jordi fita mas bda3507b62 Merge remote-tracking branch 'origin/upcoming' 2023-12-22 00:22:06 +01:00