mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
ajout restaurant et cuisine
This commit is contained in:
parent
a1c5647b43
commit
0577081581
10 changed files with 192 additions and 29 deletions
|
@ -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();
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -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 = '';
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
<input type="hidden" name="osm_kind" value="{{ osm_kind }}">
|
||||
{# nom #}
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="d-none">
|
||||
{{ dump(commerce_overpass.tags_converted) }}
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="commerce_tag_value__name" class="form-label">{{'display.keys.name'|trans}}</label>
|
||||
</div>
|
||||
|
@ -43,17 +40,22 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{# {{ dump(commerce_overpass.tags_converted) }} #}
|
||||
{% if commerce_overpass.tags_converted.image is defined %}
|
||||
|
||||
<div id="images" class="d-none">
|
||||
<img class="img-fluid img-thumbnail mb-3" src="{{ commerce_overpass.tags_converted.image }}" />
|
||||
|
||||
|
||||
url d'image de la facade : {{ commerce_overpass.tags_converted.image }}
|
||||
<input type="text" class="form-control" name="commerce_tag_value__image" value="{{ commerce_overpass.tags_converted.image }}">
|
||||
|
||||
url d'image sur Panoramax : {{ commerce_overpass.tags_converted.panoramax is defined ? commerce_overpass.tags_converted.panoramax : '' }}
|
||||
<input type="text" class="form-control" name="commerce_tag_value__panoramax" value="{{ commerce_overpass.tags_converted.panoramax is defined ? commerce_overpass.tags_converted.panoramax : '' }}">
|
||||
</div>
|
||||
{% 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
|
||||
|
@ -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 %}
|
||||
<span class="deja-rempli">
|
||||
{{ 'display.already_filled'|trans }}
|
||||
<span class="deja-rempli d-none">
|
||||
opening_hours {{ 'display.already_filled'|trans }}
|
||||
</span>
|
||||
{% 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 %}
|
||||
<span class="deja-rempli">
|
||||
<span class="deja-rempli d-none">
|
||||
{{ 'display.already_filled'|trans }}
|
||||
</span>
|
||||
|
||||
|
@ -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 %}
|
||||
<span class="deja-rempli">
|
||||
<span class="deja-rempli d-none ">
|
||||
{{ 'display.already_filled'|trans }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% include 'public/edit/ask_angela.html.twig' %}
|
||||
|
||||
|
||||
<div id="advanced_tags" class="d-none">
|
||||
{% include 'public/edit/tags.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div id="validation_messages" class="alert alert-danger d-none"></div>
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end mt-4">
|
||||
|
@ -124,6 +129,8 @@
|
|||
</div>
|
||||
<div class="row justify-content-center mt-4">
|
||||
<div class="col-12 col-lg-10 col-xl-8">
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-column flex-md-row align-items-md-center justify-content-between">
|
||||
|
@ -138,6 +145,13 @@
|
|||
{{ 'display.view_on_osm'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': commerce_overpass['tags_converted']['addr:postcode'] ?? '-1'}) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i>
|
||||
{{ 'display.view_stats'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="disclaimer mt-3 p-3 bg-light rounded">
|
||||
<p class="mb-0">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<h2>{{ 'display.address'|trans }}</h2>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-5">
|
||||
<label for="commerce_tag_value__addr:housenumber">{{'display.keys.addr:housenumber'|trans}}</label>
|
||||
<input type="text" class="form-control" name="commerce_tag_value__addr:housenumber" value="{% if commerce_overpass.tags_converted['addr:housenumber'] is defined %}{{ commerce_overpass.tags_converted['addr:housenumber'] }}{% endif %}">
|
||||
<label for="commerce_tag_value__addr:housenumber">{{'display.keys.contact:addr:housenumber'|trans}}</label>
|
||||
<input type="text" class="form-control" name="commerce_tag_value__contact:addr:housenumber" value="{% if commerce_overpass.tags_converted['contact:addr:housenumber'] is defined %}{{ commerce_overpass.tags_converted['contact:addr:housenumber'] }}{% endif %}">
|
||||
|
||||
<label for="commerce_tag_value__addr:street">{{'display.keys.addr:street'|trans}}</label>
|
||||
<input type="text" class="form-control" name="commerce_tag_value__addr:street" value="{% if commerce_overpass.tags_converted['addr:street'] is defined %}{{ commerce_overpass.tags_converted['addr:street'] }}{% endif %}">
|
||||
<label for="commerce_tag_value__contact:addr:street">{{'display.keys.contact:addr:street'|trans}}</label>
|
||||
<input type="text" class="form-control" name="commerce_tag_value__contact:addr:street" value="{% if commerce_overpass.tags_converted['contact:addr:street'] is defined %}{{ commerce_overpass.tags_converted['contact:addr:street'] }}{% endif %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
22
templates/public/edit/clim.html.twig
Normal file
22
templates/public/edit/clim.html.twig
Normal file
|
@ -0,0 +1,22 @@
|
|||
<div id="clim" class="mb-6">
|
||||
<h2 class="mb-3 title">
|
||||
<label for="commerce_tag_value__clim">
|
||||
<i class="bi bi-thermometer-half"></i>
|
||||
|
||||
{{'display.keys.clim'|trans}}</label>
|
||||
</h2>
|
||||
<div class="form-part mx-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__air_conditioning" id="clim_yes" value="yes" {% if commerce.tags_converted.air_conditioning is defined and commerce.tags_converted.air_conditioning == 'yes' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="clim_yes">Oui</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__air_conditioning" id="clim_no" value="no" {% if commerce.tags_converted.air_conditioning is defined and commerce.tags_converted.air_conditioning == 'no' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="clim_no">Non</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__air_conditioning" id="clim_unknown" value="" {% if commerce.tags_converted.air_conditioning is not defined or commerce.tags_converted.air_conditioning == '' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="clim_unknown">Je ne sais pas</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,11 +1,83 @@
|
|||
<div id="restaurant">
|
||||
|
||||
<h2 class="title mt-4">
|
||||
<label for="commerce_tag_value__cuisine">
|
||||
<i class="bi bi-fork-knife"></i>
|
||||
{{'display.keys.cuisine'|trans}}</label>
|
||||
</h2>
|
||||
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-5">
|
||||
<label for="commerce_tag_value__cuisine">{{'display.keys.cuisine'|trans}}</label>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<input type="text" class="form-control" name="commerce_tag_value__cuisine"
|
||||
placeholder="française;italienne;japonaise"
|
||||
|
||||
<div class="col-12 p-4">
|
||||
<input type="text" class="form-control d-none" name="commerce_tag_value__cuisine"
|
||||
placeholder="french;italian"
|
||||
value="{% if commerce.tags_converted.cuisine is defined %}{{ commerce.tags_converted.cuisine }}{% endif %}">
|
||||
<small class="form-text text-muted">{{'display.help.cuisine'|trans}}</small>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_chinoise" value="chinese" {% if commerce.tags_converted.cuisine is defined and 'chinese' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_chinoise">Chinoise</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_coreenne" value="korean" {% if commerce.tags_converted.cuisine is defined and 'korean' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_coreenne">Coréenne</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_francaise" value="french" {% if commerce.tags_converted.cuisine is defined and 'french' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_francaise">Française</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_indienne" value="indian" {% if commerce.tags_converted.cuisine is defined and 'indian' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_indienne">Indienne</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_italienne" value="italian" {% if commerce.tags_converted.cuisine is defined and 'italian' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_italienne">Italienne</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_japonaise" value="japanese" {% if commerce.tags_converted.cuisine is defined and 'japanese' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_japonaise">Japonaise</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_libanaise" value="lebanese" {% if commerce.tags_converted.cuisine is defined and 'lebanese' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_libanaise">Libanaise</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_thailandaise" value="thai" {% if commerce.tags_converted.cuisine is defined and 'thai' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_thailandaise">Thaïlandaise</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input col-2" type="checkbox" name="cuisine_type" id="cuisine_turque" value="turkish" {% if commerce.tags_converted.cuisine is defined and 'turkish' in commerce.tags_converted.cuisine %}checked{% endif %}>
|
||||
<label class="form-check-label col-12" for="cuisine_turque">Turque</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<h3 class="title mt-4">
|
||||
<label for="commerce_tag_value__takeaway">
|
||||
<i class="bi bi-cart-check"></i>
|
||||
{{'display.keys.takeaway'|trans}}</label>
|
||||
</h3>
|
||||
|
||||
<div class="p-4">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__takeaway" id="takeaway_yes" value="yes" {% if commerce.tags_converted.takeaway is defined and commerce.tags_converted.takeaway == 'yes' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="takeaway_yes">Oui mais pas uniquement à emporter</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__takeaway" id="takeaway_only" value="only" {% if commerce.tags_converted.takeaway is defined and commerce.tags_converted.takeaway == 'only' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="takeaway_only">Uniquement à emporter</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__takeaway" id="takeaway_no" value="no" {% if commerce.tags_converted.takeaway is defined and commerce.tags_converted.takeaway == 'no' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="takeaway_no">Nous ne proposons pas d'emporter les plats</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="commerce_tag_value__takeaway" id="takeaway_unknown" value="" {% if commerce.tags_converted.takeaway is not defined or commerce.tags_converted.takeaway == '' %}checked{% endif %}>
|
||||
<label class="form-check-label" for="takeaway_unknown">Je ne sais pas</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
1
templates/public/edit/social_media.html.twig
Normal file
1
templates/public/edit/social_media.html.twig
Normal file
|
@ -0,0 +1 @@
|
|||
{# (medias sociaux TODO) #}
|
|
@ -1,4 +1,4 @@
|
|||
<div id="wheelchair">
|
||||
<div id="wheelchair" class="d-none mt-4">
|
||||
<h2><i class="bi bi-person-wheelchair"></i> {{ 'display.wheelchair'|trans }}</h2>
|
||||
<div class="row mb-3 p-4">
|
||||
<div class="col-12">
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue