diff --git a/assets/app.js b/assets/app.js index ea61870..89eb288 100644 --- a/assets/app.js +++ b/assets/app.js @@ -157,7 +157,7 @@ document.addEventListener('DOMContentLoaded', () => { // Créer les cases à cocher pour chaque jour const jours = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche']; const joursDiv = document.createElement('div'); - joursDiv.classList.add('jours-ouverture', 'mb-4', 'row', 'g-3'); + joursDiv.classList.add('jours-ouverture', 'mb-4', 'row', 'g-3', 'mx-4'); jours.forEach(jour => { const jourContainer = document.createElement('div'); @@ -542,8 +542,37 @@ document.addEventListener('DOMContentLoaded', () => { document.querySelector('form').addEventListener('submit', check_validity); document.addEventListener('DOMContentLoaded', updateCompletionProgress); + // Focus sur le premier champ texte au chargement + const firstTextInput = document.querySelector('input.form-control'); + if (firstTextInput) { + firstTextInput.focus(); + console.log('focus sur le premier champ texte', firstTextInput); + } else { + console.log('pas de champ texte trouvé'); + } + function parseCuisine() { + const cuisineInput = document.querySelector('input[name="commerce_tag_value__cuisine"]'); + + // Récupérer tous les checkboxes de type de cuisine + const cuisineCheckboxes = document.querySelectorAll('input[name="cuisine_type"]'); + + // Ajouter un écouteur d'événement sur chaque checkbox + cuisineCheckboxes.forEach(checkbox => { + checkbox.addEventListener('change', () => { + // Récupérer toutes les checkboxes cochées + const checkedCuisines = Array.from(document.querySelectorAll('input[name="cuisine_type"]:checked')) + .map(input => input.value); + + // Mettre à jour l'input avec les valeurs séparées par des points-virgules + cuisineInput.value = checkedCuisines.join(';'); + }); + }); + } + + parseCuisine(); + }); diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index 7c61ebf..61b5b9c 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -45,6 +45,10 @@ class PublicController extends AbstractController if ($existingPlace) { // Mettre à jour l'email de la Place existante $existingPlace->setEmail($email)->setLastContactAttemptDate(new \DateTime()); + if($zipCode != -1) { + $existingPlace->setZipCode($zipCode); + } + $this->entityManager->persist($existingPlace); $this->entityManager->flush(); $debug = ''; diff --git a/src/Service/Motocultrice.php b/src/Service/Motocultrice.php index b6cf97d..ebaf6c0 100644 --- a/src/Service/Motocultrice.php +++ b/src/Service/Motocultrice.php @@ -151,9 +151,9 @@ QUERY; [out:json][timeout:25]; area["postal_code"="{$zone}"]->.searchArea; ( - nw["amenity"]["cafe|bar|restaurant"](area.searchArea); + nw["amenity"]["cafe|bar|restaurant|library|cinema|fast_food"](area.searchArea); nw["shop"](area.searchArea); - nw["tourism"="museum"](area.searchArea); + nw["tourism"="museum|hotel|chalet|apartment"](area.searchArea); nw["office"](area.searchArea); ); out body; @@ -247,6 +247,16 @@ QUERY; return $osm_object_data['node']; } if(isset($osm_object_data['way'])){ + // Vérifier si le way a des tags + if (!isset($osm_object_data['way']['tag'])) { + $osm_object_data['way']['tags_converted'] = []; + return $osm_object_data['way']; + } + + // Si un seul tag, le convertir en tableau + if (isset($osm_object_data['way']['tag']['@attributes'])) { + $osm_object_data['way']['tag'] = [$osm_object_data['way']['tag']]; + } foreach ($osm_object_data['way']['tag'] as $attribute) { $osm_object_data['way']['tags_converted'][$attribute['@attributes']['k']] = $attribute['@attributes']['v']; } diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index 0d2c22e..9bf8a1b 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -31,10 +31,7 @@
{# nom #} -
-
- {{ dump(commerce_overpass.tags_converted) }} -
+
@@ -43,18 +40,23 @@
- -{# {{ dump(commerce_overpass.tags_converted) }} #} {% if commerce_overpass.tags_converted.image is defined %} + +
+ url d'image de la facade : {{ commerce_overpass.tags_converted.image }} - + url d'image sur Panoramax : {{ commerce_overpass.tags_converted.panoramax is defined ? commerce_overpass.tags_converted.panoramax : '' }} +
+ {% endif %} + + {% if commerce_overpass.tags_converted.amenity is defined and (commerce_overpass.tags_converted.amenity == 'restaurant' or commerce_overpass.tags_converted.amenity == 'bar' or commerce_overpass.tags_converted.amenity == 'cafe' or commerce_overpass.tags_converted.amenity == 'fast_food') %} + {% include 'public/edit/restaurant.html.twig' %} {% endif %} - {% if hide_filled_inputs and (commerce_overpass.tags_converted['addr:street']) is defined and commerce_overpass.tags_converted['addr:street'] is empty and (commerce_overpass.tags_converted['addr:housenumber']) is defined and commerce_overpass.tags_converted['addr:housenumber'] is empty @@ -63,14 +65,14 @@ {% endif %} {% if hide_filled_inputs and (commerce_overpass.tags_converted.opening_hours) is defined and commerce_overpass.tags_converted.opening_hours is empty %} - - {{ 'display.already_filled'|trans }} + + opening_hours {{ 'display.already_filled'|trans }} {% endif %} {% include 'public/edit/opening_hours.html.twig' %} - + {% include 'public/edit/clim.html.twig' %} {% if hide_filled_inputs and (commerce_overpass.tags_converted.wheelchair) is defined and commerce_overpass.tags_converted.wheelchair is empty %} - + {{ 'display.already_filled'|trans }} @@ -78,13 +80,16 @@ {% include 'public/edit/wheelchair.html.twig' %} {% if hide_filled_inputs and (commerce_overpass.tags_converted.ask_angela) is defined and commerce_overpass.tags_converted.ask_angela is not empty %} - + {{ 'display.already_filled'|trans }} {% endif %} {% include 'public/edit/ask_angela.html.twig' %} + +
{% include 'public/edit/tags.html.twig' %} +
@@ -124,6 +129,8 @@
+ +
@@ -138,6 +145,13 @@ {{ 'display.view_on_osm'|trans }}
+ + + + + + {{ 'display.view_stats'|trans }} +

diff --git a/templates/public/edit/address.html.twig b/templates/public/edit/address.html.twig index e9dab4e..4481e78 100644 --- a/templates/public/edit/address.html.twig +++ b/templates/public/edit/address.html.twig @@ -2,11 +2,11 @@

{{ 'display.address'|trans }}

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

+ +

+
+
+ + +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/templates/public/edit/restaurant.html.twig b/templates/public/edit/restaurant.html.twig index 879bf17..e4b7f55 100644 --- a/templates/public/edit/restaurant.html.twig +++ b/templates/public/edit/restaurant.html.twig @@ -1,11 +1,83 @@ -
-
- -
-
- + +

+ +

+ + +
+ +
+ {{'display.help.cuisine'|trans}} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+

+ +

+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
\ No newline at end of file diff --git a/templates/public/edit/social_media.html.twig b/templates/public/edit/social_media.html.twig new file mode 100644 index 0000000..a9f84a4 --- /dev/null +++ b/templates/public/edit/social_media.html.twig @@ -0,0 +1 @@ +{# (medias sociaux TODO) #} \ No newline at end of file diff --git a/templates/public/edit/wheelchair.html.twig b/templates/public/edit/wheelchair.html.twig index ab047a6..86c3158 100644 --- a/templates/public/edit/wheelchair.html.twig +++ b/templates/public/edit/wheelchair.html.twig @@ -1,4 +1,4 @@ -
+

{{ 'display.wheelchair'|trans }}

diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml index fad5151..8a766da 100644 --- a/translations/messages.fr.yaml +++ b/translations/messages.fr.yaml @@ -24,8 +24,12 @@ display: opening_hours_description: "De bons horaires d'ouverture sont importants pour que les clients puissent vous trouver." ask_angela_yes: "Oui" ask_angela_no: "Non" + already_filled: "Ce champ est déjà rempli" closed_commerces: "Commerces fermés" places_with_note: "Lieux avec une note" + view_stats: "Statistiques de la zone" + help: + cuisine: "Sélectionnez les types de cuisine que vous proposez" values: wheelchair: yes: "le lieu est totalement praticable en fauteuil roulant" @@ -39,17 +43,24 @@ display: annex: "Annexe" cuisine: "Cuisine" keys: + cuisine: "Cuisine" + takeaway: "Commandes à emporter" + clim: "Le lieu est climatisé" tags: "étiquettes" name: "Nom du lieu, ne pas décrire le lieu" address: "Adresse" phone: "Téléphone" building: "Bâtiment" contact:email: "Email" - contact:phone: "Téléphone du contact" + contact:phone: "Téléphone" address:housenumber: "Numéro de rue" + contact:addr:housenumber: "Numéro de rue " address:street: "Rue" + contact:addr:street: "Rue " address:city: "Ville" + contact:addr:city: "Ville " address:postcode: "Code postal" + contact:addr:postcode: "Code postal " website: "Site web" contact:website: "Contact du Site web" contact:mastodon: "Contact Mastodon"