camper/web/static
jordi fita mas da127124a1 Add cover media to campsite types
This is the image that is shown at the home page, and maybe other pages
in the future.  We can not use a static file because this image can be
changed by the customer, not us; just like name and description.

I decided to keep the actual media content in the database, but to copy
this file out to the file system the first time it is accessed. This is
because we are going to replicate the database to a public instance that
must show exactly the same image, but the customer will update the image
from the private instance, behind a firewall.  We could also synchronize
the folder where they upload the images, the same way we will replicate,
but i thought that i would make the whole thing a little more brittle:
this way if it can replicate the update of the media, it is impossible
to not have its contents; dumping it to a file is to improve subsequent
requests to the same media.

I use the hex representation of the media’s hash as the URL to the
resource, because PostgreSQL’s base64 is not URL save (i.e., it uses
RFC2045’s charset that includes the forward slash[0]), and i did not
feel necessary write a new function just to slightly reduce the URLs’
length.

Before checking if the file exists, i make sure that the given hash is
an hex string, like i do for UUID, otherwise any other check is going
to fail for sure.  I moved out hex.Valid function from UUID to check for
valid hex values, but the actual hash check is inside app/media because
i doubt it will be used outside that module.

[0]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.8
2023-09-10 03:04:18 +02:00
..
ckeditor5@39.0.1 Go back to WYSIWYG for campsite types’ description and remove pages 2023-08-12 05:41:34 +02:00
fonts Add the first test for the front end design 2023-09-05 04:40:48 +02:00
images Add cover media to campsite types 2023-09-10 03:04:18 +02:00
camper.css Add the skeleton of the web application 2023-07-23 00:11:00 +02:00
camper.js Go back to WYSIWYG for campsite types’ description and remove pages 2023-08-12 05:41:34 +02:00
default_avatar.svg Add profile form, inside a user menu 2023-07-26 20:46:09 +02:00
favicon.ico Add favicon 2023-07-26 18:59:17 +02:00
htmx@1.9.3.min.js Add the logout button 2023-07-26 13:49:47 +02:00
jquery@3.7.1.min.js Add the first test for the front end design 2023-09-05 04:40:48 +02:00
public.css Add media queries to public.css to match original design 2023-09-07 11:47:18 +02:00
slick@1.8.1.css Add the first test for the front end design 2023-09-05 04:40:48 +02:00
slick@1.8.1.min.js Add the first test for the front end design 2023-09-05 04:40:48 +02:00