Commit Graph

205 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 49b5af6323 Update campground’s map icons to use Font Awesome 2024-01-27 16:16:54 +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 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 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 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 bc790762d6 Add remove_campsite_type_option function 2024-01-22 20:54:03 +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 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 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
jordi fita mas cf527ce070 Add the application’s version to the footer
This is mostly because it is required for the “Digital Kit”, but it also
works in our favor because now i can version the URL to the static
resources.

Go 1.18 adds the info from git if the package is build from a git
repository, but this is not the case in OBS, so i instead relay on a
constant for the version number.  This constant is “updated” by Debian’s
rules, mostly due to the discussion in [0].

[0]: https://github.com/golang/go/issues/22706
2024-01-21 20:50:16 +01:00
jordi fita mas d945f55096 Add “part” of the bookings’ management
“Part”, because it is not possible to add or actually manage any
booking yet, but it has the export feature that we need to validate the
project.
2024-01-18 21:05:30 +01:00
jordi fita mas c484e9bbfc Fix the age of touristic tax
It is for people aged 17 or olded, not 16.  I was confused by the
expression “over 16”, that **seems** to mean 17 or older, but actually
includes people aged 16, too.
2024-01-18 15:29:09 +01:00
oriol carbonell pujolàs 0431532ad5 Update styles 2024-01-18 03:27:07 +01:00
oriol carbonell pujolàs 72bc89ae0f Update bicycle icon 2024-01-18 03:26:52 +01:00
jordi fita mas a11ca5b470 Add page to see login attempts for a company 2024-01-17 20:28:42 +01:00
jordi fita mas f7fdc594d5 Add admin page to list the users
There is no way, for now, to add, edit or remove users, because
currently we only need to list users.

I can not give admins access to the user table, for security
permissions, so i had to create a new view.  I could name it also ‘user’
in ‘camper’ scheme, but then i was afraid i would have problems with
unit tests and their search_path, so instead i called it
‘company_user_profile’, which is like ‘user_profile’ but for all users
in ‘company_user’.

I created a new Go package for it, rather than add the admin handler in
‘auth’, because ‘template’ depends on ‘auth’, and rendering from ‘auth’
would cause a dependency loop.

I needed to have the roles in gettext to translate them, but there is
no obvious place where to put the call to PgettextNoop.  For now, there
are in ‘NewAdminHandler’ because it is called once in the application’s
lifetime and they actually do not matter much.
2024-01-17 19:42:47 +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 41fd940108 Enable autoplay to cover’s carousel 2024-01-17 13:26: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