Commit Graph

315 Commits

Author SHA1 Message Date
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
jordi fita mas 0a2911749a Fix the URL to get camper.js in admin/services/form.gohtml
Otherwise, the browser assumes they are two different resources, because
i am telling it so with the two URI, and loads the same file twice,
triggering the execution of startup functions, such as the ones that
convert textareas to CKEditor divs, twice.
2024-01-24 00:52:57 +01:00
jordi fita mas 937628ca9a Use lang-selector template for location.gohtml 2024-01-24 00:48:30 +01:00
jordi fita mas 28ab22bc22 Reduce size of icon input’s buttons 2024-01-24 00:40:19 +01:00
jordi fita mas 34a16af897 Add breadcrumb to services’ form 2024-01-24 00:36:40 +01:00
jordi fita mas adfe424bd4 Do not use sr-only for service order column
Otherwise, it seems like the header is “cut off” because it has no
bottom border.
2024-01-24 00:35:02 +01:00
jordi fita mas eb59babd86 Replace icons with designs from Font Awesome
Except for area, kayak, and plot, that do not have any equivalent in
Font Awesome.
2024-01-24 00:30:09 +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 e34f253620 Make the slogan user-editable and translatable
Because God forbid we have any performance; everything —**everything**—
must be user editable.
2024-01-23 11:52:39 +01:00
jordi fita mas 2db322a55c Add missing MethodPut to location/admin.gohtml’s MethodNotAllowed 2024-01-23 11:31:34 +01:00
jordi fita mas d96f62a0a3 Fix translation of carousel slides when changing media ID
I was trying to translate the slides that i just deleted before.
2024-01-22 21:03:00 +01:00
jordi fita mas 17aaf045bb Replace raw call to remove_campsite_type_carousel_slide with Go func 2024-01-22 20:56:48 +01:00
jordi fita mas b704f2789d Fix couple descriptions to test suite of remove_campsite_type_carousel_slide 2024-01-22 20:54:24 +01:00