Commit Graph

427 Commits

Author SHA1 Message Date
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 4adad7fa7d Replace min_nights from campsite_type_costs to range in campsite_type
Customer told us that the minimum number of nights is per campsite type,
not per season.  And he wants this, along with the maximum number of
nights, in order to limit the range of departure dates that guests can
choose when booking.
2024-01-31 23:06:45 +01:00
jordi fita mas 4f04d973c2 Dynamically set min and max to arrival and departure date inputs
The departure must be at list one day after the arrival, but no longer
than seven, due to campground’s policy.
2024-01-31 20:00:38 +01:00
jordi fita mas 51540151ff Refactor ISO date, and datestamp format in constant 2024-01-31 19:58:46 +01:00
jordi fita mas a3040cb195 Use var(--accent) for zone color 2024-01-31 15:37:03 +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
jordi fita mas d198bad91b Add a controlled layer group for the zones on the map
It seems that we have to highlight the map zones too.  On the previous
website, they had a mouseover effect that displayed a tooltip, but here
we can not do that because we use the mouse to select accommodations.

This is just a test to see whether Oriol likes how it is shown, thus the
red is likely to change to something else more pleasant to look at.
2024-01-31 15:12:11 +01:00
jordi fita mas 8c9308f1d3 Do not bring layer to front when highlighting a map accommodation
This does nothing but bring useless work to the browser, that has to
move the SVG group to the top for nothing, as the accommodations do not
overlap anything else.
2024-01-31 15:02:20 +01:00
jordi fita mas 6f78ad944f Do not set campground_map’s height via JavaScript
It already has a height set via CSS; no need to overwrite it.
2024-01-31 15:01:13 +01:00
jordi fita mas ca7d343810 Do not freak out just because the is no blooding slogan 2024-01-30 12:24:49 +01:00
jordi fita mas 036c3bc9ce Do not panic is there is no home slogan yet 2024-01-29 19:58:05 +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 1de4042d91 Handle path and rects in map
There are many installations on the map that are drawn with rect
instead of path.  I could transform them with Inkscape, but i finally
found out about DOMMatrix, that helps me a lot to convert points, as
it can parse the values of the `transform` attribute.

I also saw that SVGGraphicElements has getCTM() and getScreenCTM(), but
neither of them worked for me: the resulting transformation was “shrunk”
on the map (i.e., like it was scaled down).
2024-01-29 17:57:14 +01:00
jordi fita mas d5b61e7283 Translate map’s legend 2024-01-29 14:37:27 +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
oriol carbonell pujolàs c7670a3e10 Add IDs to amenities in map
* cr_camp_esports
 * cr_botiga
 * cr_bar
 * cr_recepcio
 * cr_edifici_serveis
 * cr_piscina
 * cr_parc
2024-01-29 13:41:14 +01:00
jordi fita mas 69415cadd6 Add a sample reservation legal text to the demo 2024-01-29 03:50:59 +01:00
jordi fita mas 23be6ff26c Add ask_zone_preferences and overflow_allowed to campsite_type
The “overflow” is for when people want to book plots for more guests
than is permitted, which the system would need to add a new plot to the
“shopping cart”, as it were; not implemented yet.

The ask zone preferences is to whether show the corresponding input on
the booking form, that it was done implicitly when the campsite type had
options, because up until now it was only for plots, but it is no longer
the case, thus i need to know when to show it; now it is explicit.
2024-01-29 03:38:11 +01:00
jordi fita mas a31f5038db Do not include inactive campsite types in booking form 2024-01-29 03:03:20 +01:00
jordi fita mas 2ec363ca63 Tag database with v2 2024-01-29 02:52:52 +01:00
jordi fita mas f5311e8b6f Add Guix package definition 2024-01-28 18:12:38 +01:00
jordi fita mas eeaa3b415e Add amenities section and public page
This is more or less the same as the campsites, as public information
goes, but for buildings and other amenities that the camping provides
that are not campsites.
2024-01-27 22:51:41 +01:00
oriol carbonell pujolàs d738603fc5 Merge branch 'master' of ssh://dev.tandem.ws:2222/tandem/camper 2024-01-27 16:17:20 +01:00
oriol carbonell pujolàs 49b5af6323 Update campground’s map icons to use Font Awesome 2024-01-27 16:16:54 +01:00
jordi fita mas 16b7a0879a Fix demo calls to add_campsite_carousel_slide and add_campsite_feature 2024-01-26 23:55:05 +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 629ef1a262 Add function to delete campsite type features 2024-01-26 22:54:19 +01:00
jordi fita mas bd124581cc Handle null strings in I18nInput.FillArray
Until now i always had the translations be empty strings if some columns
did not have the full translation, but this is going too far on the
non-NULL policy: surely they have a translations, but we do not know it
yet; this is the exact type of situations NULL values are for.

Besides the philosophical distinction, having empty strings instead of
NULLs is less practical, because i no longer can user coalesce() to
retrieve the default language text in case the translation for that
particular field is not available, even if the row for a locale exists.

In time i will change all _i18n relations, but for now only these from
campsite follow the “new policy”.
2024-01-26 22:31:11 +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 186a5fdb38 Refactor the processing of the campsite form in a common function 2024-01-25 20:57:07 +01:00
jordi fita mas ad161f57b2 Add database functions for AddCampsite and EditCampsite 2024-01-25 20:48:39 +01:00
jordi fita mas 8d49857dae Add a polygon around each accommodation on the public map
I can not use <a> in that map because Leaflet handles the mouse over
before the anchors sees it, thus it is impossible to click on them; i
have to use a Leaflet layer.

Fortunately, i can just use the <path>’s coordinates as
the polygon points, because with CRS.Simple the coordinates map to
pixel, except for the reversed Y/latitude coordinate. Unfortunately,
<path> coordinates are not straightforward to get: I have to follow the
drawing coordinates, taking into account the current transformation
(CTM), and keeping the last point around for relative coordinates.
Bézier curves are simplified to a straight line from start to end.

There is one single accommodation that started with a relative move
command (m), which apparently have to be treated as an absolute
move (M), but subsequent pairs are treated as relative coordinates[0].

It was easier for me to convert that relative move to absolute and add
a relative lineto command (l) to the next pair.

For now, all i do is highlight the accommodation and zoom it on click,
because i do not know how i should the accommodation’s information.

[0]: https://www.w3.org/TR/SVG11/paths.html#PathDataMovetoCommands
2024-01-25 04:28:51 +01:00
jordi fita mas 0da6845bde Use L.CRS.Simple in leaflet, that maps coordinates to pixels 2024-01-25 02:16:16 +01:00
jordi fita mas dc7098daf3 Correct latitude (y) and longitude (x) coordinates of map
I had them reversed.
2024-01-25 02:15:51 +01:00
jordi fita mas 623f0af2ab Fill the immediate path inside map’s anchors, and remove one extra group
In the map i added in e3503187d, paths around each accommodation
inherited the fill and stroke from the group, thus i could just override
that fill at the anchor level, but the current map sets the fill to each
accommodation’s path, party because the text is not a path too, partly
because Affinity is a visual tool only and does not give a shit about
mark up.

If we keep the text in a group, however, we can set the fill of the area
using CSS too, although it is not nice due to `!important`, but still.
There was a plot, however, #93, that had the area in a group too, and
i had to remove that group manually.
2024-01-25 01:26:02 +01:00
jordi fita mas 267ff54c60 Use same background color for selected icon than for selected language 2024-01-24 19:35:38 +01:00
jordi fita mas 7a759fe7df Remove flex: 1 from icon input’s elements to flush half-full rows left 2024-01-24 19:33:59 +01:00
jordi fita mas eae03f0bc4 Add cabin, flask_gear, grate_droplet, shirt, shop, and tent icons 2024-01-24 19:32:01 +01:00
jordi fita mas b2bd183380 Update area icon’s SVG 2024-01-24 19:15:32 +01:00
jordi fita mas 45dd3f4d15 Update ecofriendly icon’s SVG 2024-01-24 19:11:22 +01:00
oriol carbonell pujolàs 58fb39b0c7 Update weelchair icon’s SVG 2024-01-24 18:14:19 +01:00
jordi fita mas 9053f7ce92 Put back cp_ prefix for map’s accommodations and hide trees and zones
It seems that the prefix got removed in one of the edits.

Also, Affinity does not give a fuck to what classes we give to the
elements, and just removes them, thus .guest-only no longer matches, and
had to hide the layers by id.  Hope they hold this time.
2024-01-24 14:42:47 +01:00
jordi fita mas 5d45de7ef8 Replace kayak icon and add sailboat
There is no kayaking, canoe, or raft icon in Font Awesome[0], so i redid
the kayak icon in more or less the same style, but shittier, of course.

Oriol also asked me to add the sailboat, that may replace the use of
kayak.

[0]: https://github.com/FortAwesome/Font-Awesome/issues/10772
2024-01-24 12:11:58 +01:00
jordi fita mas 2c045fe7ec Replace plot icon SVG 2024-01-24 11:27:59 +01:00
jordi fita mas b67aae0936 Replace campfire icon with a better one, and add barbecue
We were using what was very clearly a campfire as the icon for the
barbecue service, when we first replaced it with a Font Awesome icon
we chose an icon that was neither campfire nor barbecue (flame-curved),
but now Oriol wanted one that left no doubt it was a barbecue.

Instead of replacing the campfire SVG with that of the barbecue, i have
chosen a campfire image from Font Awesome for our icon, and added a
separate icon for that service.
2024-01-24 11:21:08 +01:00
jordi fita mas e4cd0cc963 Remove the required attribute from service’s name input
It is virtually impossible to see when such a field fails prior to
submit the form, unless you happen to have the correct language selected
at the time.

Leave it to the backend’s validation for now.
2024-01-24 11:17:49 +01:00
jordi fita mas 7f865232e0 Remove fill="currentColor" from icons.css
It’s of no use whatsoever when the SVG is used as background image, and
it was only defined in those i extracted from the TTF with FontForge
anyway.
2024-01-24 10:57:54 +01:00
jordi fita mas 7e85270566 Add pet icon 2024-01-24 01:01:30 +01:00