Commit Graph

160 Commits

Author SHA1 Message Date
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 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 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 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 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 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 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 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
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 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
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 89f8f91a4b Avoid nested forms in admin
I was using a <form> to delete slides and other such elements before
adding the form to sort these same elements with drag and drop, without
realizing that i was wrapping the existing delete <form>s, that now
would not submit properly—they were submitting the sort form instead.
2024-01-16 18:32:02 +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
jordi fita mas 50bcbf012f Allow updating images in CKEditor-“powered” textarea
Had to create a custom build of CKEditor with the following plugins
added-in:

  * Autoformat
  * Block quote
  * Bold
  * General HTML Support
  * Heading
  * Image
  * Image caption
  * Image resize
  * Image style
  * Image toolbar
  * Image upload
  * Indent
  * Italic
  * Link
  * Link image
  * List
  * Media embed
  * Simple upload adapter
  * Source editing
  * Table
  * Table toolbar
  * Text transformation

The important bit is the “Simple uploader adapter”, that i modified to
upload the file as `media` instead of the default `upload` (i.e.,
modified ckeditor.js to replace "upload" with "media").

I also had to add the CSRF header somewhere in the HTML document for
JavaScript to be able to retrieve it and pass it to the uploader
adapter, or i would have to disable CSRF validation in that form, which
i did not like at all.
2024-01-16 01:26:35 +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 dabd197f02 Add additional information field to campsite types
This is actually just to have a fourth column in order to “balance”
lists for types that have a long descriptions.
2024-01-15 00:28:34 +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 3dbcc076d2 Merge branch 'master' of ssh://dev.tandem.ws:2222/tandem/camper 2024-01-14 21:36:16 +01:00
oriol carbonell pujolàs cb97151264 Update campground map 2024-01-14 21:36:03 +01:00
jordi fita mas 79df1736f2 Add tourist tax to company
Not used anywhere yet, but i will need it when computing the booking’s
total.
2024-01-14 02:09:17 +01:00
jordi fita mas 9b96a355a4 Automatically select the departure date when arrival changes
By default, it selects the next day, unless the new arrival date is
before the current departure, in which case is left as is, because the
idea is to help people avoid useless calendar selections when booking
for next three or four months: they would need to change the month
twice, and now only at most one.
2024-01-13 02:03:27 +01:00
jordi fita mas a226d17aa7 Add the campsite type’s name in front of price if it has options
Customer wants to explicitly show that the first price, the one on top
of the options, is for the campsite type.
2024-01-13 01:37:11 +01:00
jordi fita mas 976b2bcbcf Add position to services to be able to manually sort by admins 2024-01-13 01:15:24 +01:00
jordi fita mas 4e126237a0 Replace L10nInput with I18nInput in service
locale.Translation and form.L10nInput are no longer used.

The translation type in Postgres is now also useless, and i believe it
was never used, but i keep it because I already have a tag and i can not
just remove it, meaning that dropping it is more trouble that worth it.
2024-01-12 21:06:12 +01:00
jordi fita mas 58c3b607a1 Replace L10nInput with I18nInput in season 2024-01-12 20:26:45 +01:00
jordi fita mas 2b702d6632 Add golang template to initialize x-data for translation in admin
Had to add the DefaultLang to legal and location forms in order to use
the same template for all.
2024-01-12 19:51:12 +01:00
jordi fita mas b6cd2f7693 Use I18nInput instead of L10nInput to translate carousels 2024-01-12 19:33:44 +01:00
jordi fita mas 4d0d7a44ab Add slides to show parameter to carouselInit template
Customer wants four slides in home’s carousel, while keeping three in
the rest of the carousels.

In mobile screen, Oriol told me to always have a single slide, but in
tablet it is the given number minus one.
2024-01-11 21:04:32 +01:00
jordi fita mas 2f1895b71a Show international phone number with 00 instead of +
Customer wants it that way.
2024-01-11 20:56:35 +01:00
jordi fita mas f28664acce Replace use of L10NInput with I18nInput for campsite 2024-01-10 21:52:49 +01:00
jordi fita mas 3f46ea3a9a Add “Menu” next to the trigram symbol (“hamburger”) 2024-01-10 19:41:57 +01:00