diff --git a/assets/utils.js b/assets/utils.js
index 5abf5ad..9dd3c88 100644
--- a/assets/utils.js
+++ b/assets/utils.js
@@ -246,9 +246,16 @@ export function setupCitySearch(inputId, suggestionListId, onSelect) {
suggestions.forEach(suggestion => {
const item = document.createElement('div');
item.classList.add('suggestion-item');
- item.textContent = suggestion.display_name;
+ // Nouveau rendu : nom en gras, INSEE et CP en petit/gris
+ item.innerHTML = `
+ ${suggestion.name}
+
+ INSEE : ${suggestion.insee}
+ CP : ${Array.isArray(suggestion.postcodes) ? suggestion.postcodes.join(', ') : suggestion.postcode}
+
+ `;
item.addEventListener('click', () => {
- searchInput.value = suggestion.display_name;
+ searchInput.value = suggestion.name;
clearSuggestions();
if (onSelect) {
onSelect(suggestion);
diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php
index 40e07f8..d60ecc0 100644
--- a/src/Controller/AdminController.php
+++ b/src/Controller/AdminController.php
@@ -1924,18 +1924,48 @@ final class AdminController extends AbstractController
public static function getTagEmoji(string $mainTag): string
{
+ // Si c'est un tag clรฉ=valeur, on garde le match existant
+ if (str_contains($mainTag, '=')) {
+ return match ($mainTag) {
+ 'amenity=restaurant', 'amenity=bar', 'amenity=cafe' => '๐ฝ๏ธ',
+ 'amenity=townhall', 'amenity=community_centre' => '๐๏ธ',
+ 'amenity=bank', 'amenity=atm' => '๐ฆ',
+ 'amenity=pharmacy', 'amenity=hospital', 'amenity=clinic' => '๐ฅ',
+ 'amenity=school', 'amenity=kindergarten', 'amenity=university' => '๐',
+ 'amenity=library', 'amenity=museum', 'amenity=artwork' => '๐',
+ 'shop=car_repair', 'shop=car_parts', 'shop=car_wash' => '๐',
+ 'amenity=post_office' => '๐ฎ',
+ 'shop=convenience' => '๐ช',
+ 'shop=supermarket' => '๐',
+ 'shop=clothes' => '๐',
+ default => '๐ท๏ธ',
+ };
+ }
+ // Sinon, on regarde si c'est un tag principal simple
return match ($mainTag) {
- 'amenity=restaurant', 'amenity=bar', 'amenity=cafe' => '๐ฝ๏ธ',
- 'amenity=townhall', 'amenity=community_centre' => '๐๏ธ',
- 'amenity=bank', 'amenity=atm' => '๐ฆ',
- 'amenity=pharmacy', 'amenity=hospital', 'amenity=clinic' => '๐ฅ',
- 'amenity=school', 'amenity=kindergarten', 'amenity=university' => '๐',
- 'amenity=library', 'amenity=museum', 'amenity=artwork' => '๐',
- 'shop=car_repair', 'shop=car_parts', 'shop=car_wash' => '๐',
- 'amenity=post_office' => '๐ฎ',
- 'shop=convenience' => '๐ช',
- 'shop=supermarket' => '๐',
- 'shop=clothes' => '๐',
+ 'bicycle_parking' => '๐ฒ',
+ 'building' => '๐ข',
+ 'email' => '๐ง',
+ 'fire_hydrant' => '๐',
+ 'charging_station' => 'โก',
+ 'toilets' => '๐ป',
+ 'bus_stop' => '๐',
+ 'defibrillator' => 'โค๏ธโ๐ฉน',
+ 'camera' => '๐ท',
+ 'recycling' => 'โป๏ธ',
+ 'substation' => '๐ญ',
+ 'laboratory' => '๐งช',
+ 'school' => '๐ซ',
+ 'police' => '๐ฎ',
+ 'healthcare' => '๐ฅ',
+ 'advertising_board' => '๐ชง',
+ 'bench' => '๐ช',
+ 'waste_basket' => '๐๏ธ',
+ 'street_lamp' => '๐ก',
+ 'drinking_water' => '๐ฐ',
+ 'tree' => '๐ณ',
+ 'places' => '๐',
+ 'power_pole' => 'โก',
default => '๐ท๏ธ',
};
}
diff --git a/templates/admin/followup_graph.html.twig b/templates/admin/followup_graph.html.twig
index ba93d4d..afebede 100644
--- a/templates/admin/followup_graph.html.twig
+++ b/templates/admin/followup_graph.html.twig
@@ -37,7 +37,7 @@
- {{ diff.label }}
+ {{ tag_emoji(type) }} {{ diff.label }}
|
diff --git a/templates/admin/stats.html.twig b/templates/admin/stats.html.twig
index a734129..71d00cc 100644
--- a/templates/admin/stats.html.twig
+++ b/templates/admin/stats.html.twig
@@ -655,6 +655,36 @@
document.addEventListener('DOMContentLoaded', function() {
const geojsonData = {{ geojson|raw }};
const map_token = "{{ maptiler_token }}";
+ // Liste des tags attendus pour la complรฉtion des lieux
+ const completionTags = {{ completion_tags['places']|json_encode|raw }};
+ // Calcul de la complรฉtion et des tags manquants pour chaque lieu
+ geojsonData.features.forEach(f => {
+ let filled = 0;
+ let missing = [];
+ if (completionTags && completionTags.length > 0) {
+ completionTags.forEach(tag => {
+ if (f.properties && typeof f.properties[tag] !== 'undefined' && f.properties[tag] !== null && f.properties[tag] !== '') {
+ filled++;
+ } else {
+ missing.push(tag);
+ }
+ });
+ }
+ f.properties.completion = completionTags && completionTags.length > 0 ? Math.round(100 * filled / completionTags.length) : null;
+ // Correction : toujours un tableau
+ f.properties.missing_tags = Array.isArray(f.properties.missing_tags) ? f.properties.missing_tags : (f.properties.missing_tags ? [f.properties.missing_tags] : []);
+ });
+ // Fonction de couleur dรฉgradรฉe
+ function lerpColor(a, b, t) {
+ const ah = a.replace('#', '');
+ const bh = b.replace('#', '');
+ const ar = parseInt(ah.substring(0,2), 16), ag = parseInt(ah.substring(2,4), 16), ab = parseInt(ah.substring(4,6), 16);
+ const br = parseInt(bh.substring(0,2), 16), bg = parseInt(bh.substring(2,4), 16), bb = parseInt(bh.substring(4,6), 16);
+ const rr = Math.round(ar + (br-ar)*t);
+ const rg = Math.round(ag + (bg-ag)*t);
+ const rb = Math.round(ab + (bb-ab)*t);
+ return '#' + rr.toString(16).padStart(2,'0') + rg.toString(16).padStart(2,'0') + rb.toString(16).padStart(2,'0');
+ }
let map;
let map_is_loaded = false;
let currentMode = 'drop';
@@ -682,10 +712,9 @@
'case',
['has', 'completion'],
[
- 'rgb',
- 0,
- ['*', ['get', 'completion'], 2.55],
- 0
+ 'interpolate', ['linear'], ['get', 'completion'],
+ 0, '#cccccc',
+ 100, '#008000'
],
'#cccccc'
],
@@ -701,7 +730,16 @@
source: 'places',
filter: ['!', ['has', 'point_count']],
paint: {
- 'circle-color': '#11b4da',
+ 'circle-color': [
+ 'case',
+ ['has', 'completion'],
+ [
+ 'interpolate', ['linear'], ['get', 'completion'],
+ 0, '#cccccc',
+ 100, '#008000'
+ ],
+ '#cccccc'
+ ],
'circle-radius': 8,
'circle-stroke-width': 2,
'circle-stroke-color': '#fff'
@@ -795,7 +833,12 @@
if (properties.address) popupContent += `${properties.address} `;
if (properties.main_tag) popupContent += `${properties.main_tag} `;
if (properties.note) popupContent += `Note: ${properties.note} `;
- popupContent += `Voir sur OSM`;
+ popupContent += `Complรฉtion : ${properties.completion !== null ? properties.completion + '%' : 'โ'}`;
+ const missingTags = Array.isArray(properties.missing_tags) ? properties.missing_tags : [];
+ if (missingTags.length > 0) {
+ popupContent += `Manque : ${missingTags.map(t => `${t} `).join(', ')} `;
+ }
+ popupContent += ` Voir sur OSM`;
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
diff --git a/templates/public/stats_evolutions.html.twig b/templates/public/stats_evolutions.html.twig
index c6e945e..71cea2e 100644
--- a/templates/public/stats_evolutions.html.twig
+++ b/templates/public/stats_evolutions.html.twig
@@ -29,7 +29,7 @@
title="Voir le graphe dรฉtaillรฉ">
- {{ type }}
+ {{ tag_emoji(type) }} {{ type }}
|
{{ evo.now }} |
{% for p in periods %}