Commit Graph

304 Commits

Author SHA1 Message Date
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
jordi fita mas bc790762d6 Add remove_campsite_type_option function 2024-01-22 20:54:03 +01:00
jordi fita mas 5cc5fca6b5 Remove unnecessary receiver from campsite.AdminHandler.deleteSlide 2024-01-22 20:53:01 +01:00
jordi fita mas 1f2ab494dd Add check_in and check_out fields to campsite_type
Apparently, each campsite type could have different check-in and
check-out times, thus i need them in the database.

I thought about using an integer or a datetime field, but customer seems
to want a text field to maybe add “before” and “after” there as well.
Translatable text it is.
2024-01-22 20:19:19 +01:00
jordi fita mas 4138eda5cb Add Error method to I18nInput
Otherwise, we can not show the error message to the user, although it
assumes only the default language has error message, which is the case
for now, but….
2024-01-22 20:15:26 +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
jordi fita mas fe9abf7d75 Add rel="terms-of-service" to booking form’s link to conditions
I also changed the translatable link to not include any HTML, because it
meant that i had to retranslate them just to add a new attribute, that
does not make much sense—the attribute is not even translatable, thus
all translations must include it verbatim.
2024-01-22 03:41:54 +01:00
jordi fita mas 8fa9755c8e Fix breadcrumb title in season’s form.gohtml 2024-01-22 03:39:54 +01:00
jordi fita mas 77cbb3c212 Fix SQL to get list of all accommodation options for booking form
I was using the wrong fields to join with i18n, and had the parameters
to coalesce function call reversed.
2024-01-22 03:24:53 +01:00
jordi fita mas 26cc46c7b0 Add breadcrumb to all admin pages
I tried to use ../, and ../../ to make the routes relatives, but it
would not work well because the same page would have two URLs, one
ending with slash and another without, and the relative links would be
different on each case.
2024-01-21 22:44:04 +01:00
jordi fita mas 6ddc41e293 Remove trailing slash from <link> in public layout 2024-01-21 21:12:12 +01:00
jordi fita mas 64dc533949 Remove the extra <div> when saving content from CKEditor
I need to have a single top-level element in order to serialize to XML
when returning the editor’s content back to the text area, because,
unlike PostgreSQL, XMLSerializer only works with XML documents.

I added a <div> because this is the least “semantic” block element there
is, but Oriol seems to have trouble in services when trying to align
services using a grid due to this extra div.

Now i still use the div to serialize to XML, but then remove that
top-level element from the output string by stripping out its label. I
 can not be sure that all browsers would serialize the <div> in the
 same way, thus i can not use fixed indices in call to substring.
2024-01-21 21:04:51 +01:00