From f15fec6d187e1fc16563882a08922020116be347 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 26 May 2025 19:03:34 +0200 Subject: [PATCH] up templates --- README.md | 13 ++ cipherbliss-osm-commerce.config.caddy | 24 ++++ templates/public/edit.html.twig | 120 +++--------------- templates/public/edit/address.html.twig | 10 ++ templates/public/edit/ask_angela.html.twig | 15 +++ templates/public/edit/opening_hours.html.twig | 22 ++++ templates/public/edit/restaurant.html.twig | 11 ++ templates/public/edit/tags.html.twig | 22 ++++ templates/public/edit/townhall.html.twig | 11 ++ templates/public/edit/wheelchair.html.twig | 15 +++ translations/messages.en.yaml | 1 + translations/messages.fr.yaml | 26 +++- 12 files changed, 185 insertions(+), 105 deletions(-) create mode 100644 cipherbliss-osm-commerce.config.caddy create mode 100644 templates/public/edit/address.html.twig create mode 100644 templates/public/edit/ask_angela.html.twig create mode 100644 templates/public/edit/opening_hours.html.twig create mode 100644 templates/public/edit/restaurant.html.twig create mode 100644 templates/public/edit/tags.html.twig create mode 100644 templates/public/edit/townhall.html.twig create mode 100644 templates/public/edit/wheelchair.html.twig diff --git a/README.md b/README.md index 8090b85..dca5af9 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,19 @@ déployer sur un serveur ayant du php 8 créer un utilisateur et sa base +## en postgresql +```shell sudo -u postgres psql -c "CREATE USER sf WITH PASSWORD 'sfrgdHYJi56631lyshFSQGfd45452ùwdf54f8fg5dfhg5_tyfdgthIOPHFUGH';" sudo -u postgres psql -c "CREATE DATABASE \"osm-my-commerce\" OWNER sf;" +``` +## en mysql + +```shell +mysql -u root -p +CREATE USER 'sf'@'localhost' IDENTIFIED BY 'sfrgdHYJi56631lyshFSQGfd45452ùwdf54f8fg5dfhg5_tyfdgthIOPHFUGH'; +CREATE DATABASE `osm-my-commerce`; +GRANT ALL PRIVILEGES ON `osm-my-commerce`.* TO 'sf'@'localhost'; +FLUSH PRIVILEGES; + +``` diff --git a/cipherbliss-osm-commerce.config.caddy b/cipherbliss-osm-commerce.config.caddy new file mode 100644 index 0000000..d112840 --- /dev/null +++ b/cipherbliss-osm-commerce.config.caddy @@ -0,0 +1,24 @@ +osm-commerces.cipherbliss.com { + root * /home/poule/encrypted/stockage-syncable/www/development/html/osm-commerce-sf/public + + # serve files directly if they can be found (e.g. CSS or JS files in public/) + encode zstd gzip + file_server + + # otherwise, use PHP-FPM (replace "unix//var/..." with "127.0.0.1:9000" when using TCP) + php_fastcgi unix//var/run/php/php8.4-fpm.sock { + # only fall back to root index.php aka front controller. + try_files {path} index.php + } + + # Logs + log { + output file /var/log/caddy/access-osm-commerce-sf.log + format console + } + + @phpFile { + path *.php* + } + error @phpFile "Not found" 404 +} \ No newline at end of file diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index f29e7ea..a2fa219 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -61,7 +61,15 @@

@@ -92,118 +100,22 @@ {% if commerce.tags_converted.amenity is defined %} {% if commerce.tags_converted.amenity == 'townhall' %} -
-
- - - -
-
+ {% include 'public/edit/townhall.html.twig' %} {% endif %} {% if commerce.tags_converted.amenity == 'restaurant' %} -
-
- -
-
- - {{'display.help.cuisine'|trans}} -
-
+ {% include 'public/edit/restaurant.html.twig' %} {% endif %} {% endif %}
-
-

{{ 'display.ask_angela'|trans }}

-

{{ 'display.ask_angela_description'|trans }}

-

- {{ 'display.ask_angela_more_info'|trans }} -

-
-
- - - -
-
-
- -
-

{{ 'display.wheelchair'|trans }}

-
-
- - - -
-
-
-
-

{{ 'display.opening_hours'|trans }}

-

{{ 'display.opening_hours_description'|trans }}

- - - Lundi de - - - à - . - - - et - - - à - . - - -
- -
-
-

{{ 'display.address'|trans }}

-
-
- - - -
-
-
-
- {% for attributes in commerce.tag %} - {% for kv in attributes %} - {% if kv.k == 'opening_hours' %} - {{ 'display.keys.opening_hours'|trans }} - {% else %} -
-
- - {{ ('display.keys.' ~ kv.k)|trans }} -
-
- -
-
- {% endif %} - {% endfor %} - {% endfor %} -
+ {% include 'public/edit/ask_angela.html.twig' %} + {% include 'public/edit/wheelchair.html.twig' %} + {% include 'public/edit/opening_hours.html.twig' %} + {% include 'public/edit/address.html.twig' %} + {% include 'public/edit/tags.html.twig' %} diff --git a/templates/public/edit/address.html.twig b/templates/public/edit/address.html.twig new file mode 100644 index 0000000..16e5c83 --- /dev/null +++ b/templates/public/edit/address.html.twig @@ -0,0 +1,10 @@ +
+

{{ 'display.address'|trans }}

+
+
+ + + +
+
+
\ No newline at end of file diff --git a/templates/public/edit/ask_angela.html.twig b/templates/public/edit/ask_angela.html.twig new file mode 100644 index 0000000..73fc063 --- /dev/null +++ b/templates/public/edit/ask_angela.html.twig @@ -0,0 +1,15 @@ +
+

{{ 'display.ask_angela'|trans }}

+

{{ 'display.ask_angela_description'|trans }}

+

+ {{ 'display.ask_angela_more_info'|trans }} +

+ +
+
+ + + +
+
+
\ No newline at end of file diff --git a/templates/public/edit/opening_hours.html.twig b/templates/public/edit/opening_hours.html.twig new file mode 100644 index 0000000..b93fa6c --- /dev/null +++ b/templates/public/edit/opening_hours.html.twig @@ -0,0 +1,22 @@ +
+

{{ 'display.opening_hours'|trans }}

+

{{ 'display.opening_hours_description'|trans }}

+ + + Lundi de + + + à + . + + + et + + + à + . + + +
+ +
\ No newline at end of file diff --git a/templates/public/edit/restaurant.html.twig b/templates/public/edit/restaurant.html.twig new file mode 100644 index 0000000..879bf17 --- /dev/null +++ b/templates/public/edit/restaurant.html.twig @@ -0,0 +1,11 @@ +
+
+ +
+
+ + {{'display.help.cuisine'|trans}} +
+
\ No newline at end of file diff --git a/templates/public/edit/tags.html.twig b/templates/public/edit/tags.html.twig new file mode 100644 index 0000000..23b39ca --- /dev/null +++ b/templates/public/edit/tags.html.twig @@ -0,0 +1,22 @@ +{% block tags %}
+
+ + {% for attributes in commerce.tag %} + {% for kv in attributes %} + {# {% if kv.k == 'opening_hours' %} + {{ 'display.keys.opening_hours'|trans }} + {% else %} #} +
+
+ + {{ ('display.keys.' ~ kv.k)|trans }} +
+
+ +
+ {# {% endif %} #} + {% endfor %} + {% endfor %} + +
+{% endblock %} \ No newline at end of file diff --git a/templates/public/edit/townhall.html.twig b/templates/public/edit/townhall.html.twig new file mode 100644 index 0000000..c520855 --- /dev/null +++ b/templates/public/edit/townhall.html.twig @@ -0,0 +1,11 @@ +
+
+ + + +
+
\ No newline at end of file diff --git a/templates/public/edit/wheelchair.html.twig b/templates/public/edit/wheelchair.html.twig new file mode 100644 index 0000000..88d67fd --- /dev/null +++ b/templates/public/edit/wheelchair.html.twig @@ -0,0 +1,15 @@ +
+

{{ 'display.wheelchair'|trans }}

+
+
+ + + +
+
+
\ No newline at end of file diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index bc6cae3..2bc8f3b 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -21,6 +21,7 @@ display: attributes: 'Attributes' opening_hours: 'Opening hours' opening_hours_description: 'Good opening hours are important for customers to find you.' + unknown: 'Unknown' values: wheelchair: yes: 'the place is fully accessible in wheelchair' diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml index 3cedfa3..bf4fc33 100644 --- a/translations/messages.fr.yaml +++ b/translations/messages.fr.yaml @@ -13,16 +13,33 @@ display: by: "par" view_on_osm: "Voir sur OpenStreetMap" please_select: "Veuillez sélectionner" + unknown: "Inconnu" + wheelchair: "Accès PMR" + ask_angela: "Demander Angela" + ask_angela_description: "Ce lieu participe à la campagne nationale 'Demander Angela' pour aider à la prévention du harcèlement" + ask_angela_more_info: "Plus d'informations sur la campagne" + address: "Adresse" + attributes: "Attributs" + opening_hours: "Horaires d'ouverture" + opening_hours_description: "De bons horaires d'ouverture sont importants pour que les clients puissent vous trouver." values: - wheelchair: "Accès PMR" + wheelchair: yes: "le lieu est totalement praticable en fauteuil roulant" limited: "le lieu est accessible en fauteuil roulant mais pas partout" no: "le lieu n'est pas accessible en fauteuil roulant" + angela: + yes: "Oui" + no: "Non" + building: + main: "Principal" + annex: "Annexe" + cuisine: "Cuisine" keys: tags: "étiquettes" name: "Nom" address: "Adresse" phone: "Téléphone" + building: "Bâtiment" contact:email: "Email" contact:phone: "Téléphone du contact" address:housenumber: "Numéro de rue" @@ -35,6 +52,13 @@ display: shop: "Type de commerce" tourism: "Tourisme" wheelchair: "Accès PMR" + addr:housenumber: "Numéro de rue" + addr:street: "Rue" + addr:city: "Ville" + addr:postcode: "Code postal" + amenity: "Équipement" + source: "Source" + ref:FR:SIRET: "SIRET" disclaimer: title: "Attention" text: "Ce site est un travail en cours, ceci est une démonstration sur un objet fictif qui utilise les données de l'API OpenStreetMap."