diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 0ded79d..dd48489 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -270,8 +270,8 @@ final class AdminController extends AbstractController { $stats = $this->entityManager->getRepository(Stats::class)->findOneBy(['zone' => $insee_code]); if (!$stats) { - $this->addFlash('error', 'Aucune stats trouvée pour ce code INSEE.'); - return $this->redirectToRoute('app_admin'); + $this->addFlash('error', 'Aucune stats trouvée pour ce code INSEE. Veuillez d\'abord ajouter la ville.'); + return $this->redirectToRoute('app_admin_import_stats'); } $followups = $stats->getCityFollowUps(); $refresh = false; diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index 2cb0d0e..35fbec5 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -458,7 +458,7 @@ class PublicController extends AbstractController $stats = $place->getStats(); if (!$stats) { - $stats = $this->entityManager->getRepository(Stats::class)->findOneBy(['zip_code' => $place->getZipCode()]); + $stats = $this->entityManager->getRepository(Stats::class)->findOneBy(['zone' => $place->getZipCode()]); } if (!$stats) { $stats = new Stats(); diff --git a/templates/admin/_followup_bicycle_parking_extra.html.twig b/templates/admin/_followup_bicycle_parking_extra.html.twig new file mode 100644 index 0000000..19826e1 --- /dev/null +++ b/templates/admin/_followup_bicycle_parking_extra.html.twig @@ -0,0 +1,165 @@ +{# + Template d'infos supplémentaires pour la thématique "bicycle_parking" + À inclure dans followup_theme_graph.html.twig si theme == 'bicycle_parking' + Nécessite que la variable JS "countData" soit disponible (données du graphe) + Nécessite que la variable stats.population soit transmise au template parent +#} +
+
+ Infos vélo : capacité totale des parkings à vélo et voies cyclables +
+
+
+ Chargement des statistiques vélo... +
+
+ Pensez à renseigner le tag capacity sur chaque parking vélo pour améliorer la connaissance de l'offre cyclable.
+ Les longueurs de voies cyclables sont calculées à partir des géométries OSM (approximation). +
+
+
+ \ No newline at end of file diff --git a/templates/admin/followup_theme_graph.html.twig b/templates/admin/followup_theme_graph.html.twig index 3a7ccf0..865e43e 100644 --- a/templates/admin/followup_theme_graph.html.twig +++ b/templates/admin/followup_theme_graph.html.twig @@ -123,6 +123,7 @@ {% block body %}
+ {# DEBUG : Affichage des objets Place trouvés pour cette ville #} {% if places is defined %}
@@ -187,6 +188,10 @@
+{% if theme == 'bicycle_parking' %} + {% include 'admin/_followup_bicycle_parking_extra.html.twig' %} +{% endif %} + {% if overpass_query is defined %} @@ -199,12 +204,7 @@ {% else %}
Aucun objet sélectionné pour ce thème, rien à charger dans JOSM.
- {% endif %} - {# - #} + {% endif %}
@@ -290,6 +290,7 @@ Faire une suggestion + {% endblock %} {% block javascripts %}