menu latéral ville

This commit is contained in:
Tykayn 2025-07-16 17:31:15 +02:00 committed by tykayn
parent f4c5e048ff
commit 2e459122b5
11 changed files with 1008 additions and 236 deletions

View file

@ -0,0 +1,73 @@
{# City Sidebar Template #}
<div class="city-sidebar">
<h5 class="mb-3">{{ stats.name }}</h5>
<p class="badge {% if stats.getCompletionPercent() > 85 %}bg-success{% else %}bg-warning{% endif %} mb-3">
{{ stats.getCompletionPercent() }}% complété
</p>
<!-- Sections de la page -->
<div class="sidebar-heading">Sections</div>
<nav class="nav flex-column">
<a class="nav-link {% if active_menu == 'info-generales' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#info-generales">
<i class="bi bi-info-circle"></i> Informations générales
</a>
<a class="nav-link {% if active_menu == 'themes' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#themes">
<i class="bi bi-tags"></i> Thèmes
</a>
<a class="nav-link {% if active_menu == 'carte' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#carte">
<i class="bi bi-map"></i> Carte
</a>
<a class="nav-link {% if active_menu == 'graphiques' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#graphiques">
<i class="bi bi-graph-up"></i> Graphiques
</a>
<a class="nav-link {% if active_menu == 'lieux' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#lieux">
<i class="bi bi-building"></i> Lieux
</a>
<a class="nav-link {% if active_menu == 'podium' %}active{% endif %}" href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}#podium">
<i class="bi bi-trophy"></i> Podium
</a>
</nav>
<!-- Pages liées -->
<div class="sidebar-heading">Pages liées</div>
<nav class="nav flex-column">
<a class="nav-link {% if active_menu == 'labourer' %}active{% endif %}" href="{{ path('app_admin_labourer', {'insee_code': stats.zone, 'deleteMissing': 1}) }}">
<i class="bi bi-tools"></i> Labourer les mises à jour
</a>
<a class="nav-link {% if active_menu == 'followup_graph' %}active{% endif %}" href="{{ path('admin_followup_graph', {'insee_code': stats.zone}) }}">
<i class="bi bi-graph-up"></i> Suivi OSM (graphes)
</a>
<a class="nav-link {% if active_menu == 'stats_evolutions' %}active{% endif %}" href="{{ path('app_public_stats_evolutions', {'insee_code': stats.zone}) }}">
<i class="bi bi-activity"></i> Évolutions des objets
</a>
<a class="nav-link {% if active_menu == 'street_completion' %}active{% endif %}" href="{{ path('admin_street_completion', {'insee_code': stats.zone}) }}">
<i class="bi bi-signpost"></i> Complétion des rues
</a>
<a class="nav-link {% if active_menu == 'speed_limit' %}active{% endif %}" href="{{ path('admin_speed_limit', {'insee_code': stats.zone}) }}">
<i class="bi bi-speedometer2"></i> Limites de vitesse
</a>
<a class="nav-link {% if active_menu == 'city_demandes' %}active{% endif %}" href="{{ path('app_public_city_demandes', {'insee_code': stats.zone}) }}">
<i class="bi bi-list-check"></i> Demandes
</a>
</nav>
<!-- Flux RSS -->
<div class="sidebar-heading">Flux RSS</div>
<nav class="nav flex-column">
<a class="nav-link" href="{{ path('app_public_rss_city_demandes', {'insee_code': stats.zone}) }}" target="_blank">
<i class="bi bi-rss"></i> Demandes
</a>
<a class="nav-link" href="{{ path('app_public_rss_city_themes', {'insee_code': stats.zone}) }}" target="_blank">
<i class="bi bi-rss"></i> Changements thématiques
</a>
</nav>
<!-- Actions -->
<div class="sidebar-heading">Actions</div>
<button id="openInJOSM" class="btn btn-secondary btn-sm w-100 mb-2">
<i class="bi bi-map"></i> Ouvrir dans JOSM
</button>
<a href="{{ path('app_admin_labourer', {'insee_code': stats.zone, 'deleteMissing': 1, 'disableFollowUpCleanup': 1}) }}" class="btn btn-warning btn-sm w-100" title="Labourer sans nettoyer les suivis OSM">
<i class="bi bi-shield-check"></i> Labourer (sans nettoyage)
</a>
</div>

View file

@ -6,6 +6,7 @@
{% block stylesheets %}
{{ parent() }}
<link href='{{ asset('js/maplibre/maplibre-gl.css') }}' rel='stylesheet' />
<link href='{{ asset('css/city-sidebar.css') }}' rel='stylesheet' />
<style>
.completion-circle {
fill-opacity: 0.6;
@ -62,26 +63,26 @@
background: #388e3c;
border-color: #1b5e20;
}
.compact-theme-card {
transition: transform 0.2s ease-in-out;
}
.compact-theme-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}
.theme-title a {
font-size: 0.85rem;
line-height: 1.2;
}
.theme-stats {
font-size: 0.75rem;
color: #6c757d;
}
.theme-actions .btn {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
@ -115,35 +116,22 @@
{% block body %}
<div class="container">
<div class="mt-4 p-4">
<div class="row">
<div class="col-md-6 col-12">
<h1 class="title">{{ 'display.stats'|trans }} - {{ stats.zone }}
{{ stats.name }} - {{ stats.completionPercent }}% complété</h1>
</div>
<div class="col-md-6 col-12">
<a href="{{ path('app_admin_labourer', {'insee_code': stats.zone, 'deleteMissing': 1}) }}" class="btn btn-primary" id="labourer">Labourer les mises à jour</a>
<a href="{{ path('app_admin_labourer', {'insee_code': stats.zone, 'deleteMissing': 1, 'disableFollowUpCleanup': 1}) }}" class="btn btn-warning ms-2" id="labourer-no-cleanup" title="Labourer sans nettoyer les suivis OSM">
<i class="bi bi-shield-check"></i> Labourer (sans nettoyage)
</a>
<a href="{{ path('admin_followup_graph', {'insee_code': stats.zone}) }}" class="btn btn-info ms-2" id="followup-graph-link">
<i class="bi bi-graph-up"></i> Suivi OSM (graphes)
</a>
<button id="openInJOSM" class="btn btn-secondary ms-2">
<i class="bi bi-map"></i> Ouvrir dans JOSM
</button>
<a href="{{ path('app_public_stats_evolutions', {'insee_code': stats.zone}) }}" class="btn btn-outline-info ms-2">
<i class="bi bi-activity"></i> Évolutions des objets
</a>
<a href="{{ path('admin_street_completion', {'insee_code': stats.zone}) }}" class="btn btn-outline-success ms-2">
<i class="bi bi-signpost"></i> Complétion des rues
</a>
<a href="{{ path('admin_speed_limit', {'insee_code': stats.zone}) }}" class="btn btn-outline-danger ms-2">
<i class="bi bi-speedometer2"></i> Limites de vitesse
</a>
</div>
<div class="container-fluid">
<div class="row">
<!-- Sidebar de navigation -->
<div class="col-12">
{% include 'admin/_city_sidebar.html.twig' with {'stats': stats, 'active_menu': 'info-generales'} %}
</div>
<!-- Contenu principal -->
<div class="col-md-9 col-lg-10 main-content">
<div class="p-4">
<div class="row">
<div class="col-12">
<h1 class="title" id="info-generales">{{ 'display.stats'|trans }} - {{ stats.zone }}
{{ stats.name }} - {{ stats.completionPercent }}% complété</h1>
</div>
</div>
{% if stats.population %}
<div class="row mb-3">
<div class="col-md-4 col-12">
@ -184,17 +172,17 @@
</div>
{% endif %}
{% endif %}
{% if stats.dateLabourageDone %}
<div class="alert alert-info">
Dernier labourage : {{ include('admin/_labourage_time_ago.html.twig', { date: stats.dateLabourageDone }) }}
</div>
{% endif %}
<div class="row">
<div id="followups">
{% set overpass_type_queries = {
'fire_hydrant': 'nwr["emergency"="fire_hydrant"](area.searchArea);',
@ -222,8 +210,9 @@
'infrastructure': ['toilets', 'recycling', 'substation']
} %}
<div class="row mb-4">
<div class="row mb-4" id="themes">
<div class="col-12">
<h2 class="section-anchor">Thèmes</h2>
<ul class="nav nav-tabs" id="themeTabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="tab-table" data-bs-toggle="tab" data-bs-target="#tabTableContent" type="button" role="tab" aria-controls="tabTableContent" aria-selected="true">Tableau</button>
@ -427,14 +416,16 @@
</div>
</div>
<div id="maploader">
<div class="spinner-border" role="status">
<i class="bi bi-load bi-spin"></i>
<span class="visually-hidden">Chargement de la carte...</span>
</div>
</div>
<div id="carte" class="section-anchor">
<h2>Carte</h2>
<div id="maploader">
<div class="spinner-border" role="status">
<i class="bi bi-load bi-spin"></i>
<span class="visually-hidden">Chargement de la carte...</span>
</div>
</div>
<div class="d-flex justify-content-end mb-2">
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-primary" id="circleMarkersBtn">
@ -449,26 +440,27 @@
</button>
</div>
<div id="map" style="height: 400px; width: 100%; margin-bottom: 1rem;"></div>
<div class="row ">
<div class="col-md-6 col-12 ">
<canvas id="repartition_tags" width="600" height="400" style="max-width:100%; margin: 20px 0;"></canvas>
<div id="graphiques" class="section-anchor">
<h2>Graphiques</h2>
<div class="row">
<div class="col-md-6 col-12">
<canvas id="repartition_tags" width="600" height="400" style="max-width:100%; margin: 20px 0;"></canvas>
</div>
<div class="col-md-6 col-12">
<div class="card">
<div class="card-header">
<i class="bi bi-calendar-event"></i> Fréquence des mises à jour par trimestre pour {{stats.name}}
</div>
<div class="card-body">
<canvas id="modificationsByQuarterChart" style="min-height: 250px; width: 100%;"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-12 ">
<div class="card">
<div class="card-header">
<i class="bi bi-calendar-event"></i> Fréquence des mises à jour par trimestre pour {{stats.name}}
</div>
<div class="card-body">
<canvas id="modificationsByQuarterChart" style="min-height: 250px; width: 100%;"></canvas>
</div>
</div>
</div>
</div>
<div id="attribution">
<a href="https://www.openstreetmap.org/copyright">Données OpenStreetMap</a>
@ -479,9 +471,9 @@
<canvas id="distribution_completion" class="mt-4 mb-4" height="400"></canvas>
<div class="row">
<div class="row" id="lieux">
<div class="col-md-6 col-12">
<h1 class="card-title p-4">Tableau des {{ stats.places |length }} lieux</h1>
<h1 class="card-title p-4 section-anchor">Tableau des {{ stats.places |length }} lieux</h1>
</div>
<div class="col-md-6 col-12">
<div class="btn-group mt-4" role="group">
@ -507,8 +499,8 @@
</tbody>
</table>
</div>
</div>
<div class="card mt-4" id="podium">
@ -574,7 +566,7 @@
<div class="card-header">
<h2>Requête Overpass</h2>
<div id=overPassRequest >
<pre>
{{overpass}}
</pre>
@ -609,9 +601,9 @@
<div class="accordion mb-3" id="accordionStats">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
</div>
</div>
<h2 class="accordion-header" id="headingOne"></h2>
</div>
</div>
<!-- Espace de dump JSON -->
<div id="ctc-json-dump-container" class="mt-4" style="display:none;">
@ -653,8 +645,12 @@
</div>
</div>
</div>
<div id="ctc-json-error" class="alert alert-danger mt-4" style="display:none;"></div>
</div>
</div>
</div>
</div>
{% endblock %}
@ -935,7 +931,7 @@
x: { title: { display: true, text: 'Trimestre' } }
}
}
});
} else if (modifCanvas) {
modifCanvas.parentNode.innerHTML = '<div class="alert alert-info">Aucune donnée de modification disponible pour cette ville.</div>';
@ -1026,20 +1022,17 @@
const completionValues = completionLabels.map(label => completionDistribution[label]);
const dc = document.getElementById('distribution_completion');
if(dc ){
if(dc){
const completionCtx = dc.getContext ? dc.getContext('2d') : null;
if(!completionCtx){
console.log('pas de completionCtx' )
return ;
}
console.log('pas de completionCtx');
} else {
new Chart(completionCtx, {
type: 'line',
type: 'bar',
data: {
labels: completionLabels,
tension: 0.3,
datasets: [{
label: 'Distribution du Taux de Complétion',
label: 'Évolution du taux de complétion',
data: completionValues,
backgroundColor: 'rgba(75, 192, 192, 0.5)',
borderColor: 'rgba(75, 192, 192, 1)',
@ -1052,13 +1045,23 @@ if(dc ){
beginAtZero: true
}
},
responsive: true,
responsive: true,
plugins: {
title: {
display: true,
text: 'Évolution du taux de complétion',
font: {
size: 16
}
}
}
}
});
}else{
console.log('pas de distribution_completion')
}
} else {
console.log('pas de distribution_completion');
}
});
</script>
<script>

View file

@ -0,0 +1,118 @@
{% extends 'base.html.twig' %}
{% block title %}Demandes pour {{ city.name }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link href='{{ asset('css/city-sidebar.css') }}' rel='stylesheet' />
{% endblock %}
{% block body %}
<div class="container-fluid">
<div class="row">
<!-- Sidebar de navigation -->
<div class="col-12">
{% include 'admin/_city_sidebar.html.twig' with {'stats': city, 'active_menu': 'city_demandes'} %}
</div>
<!-- Contenu principal -->
<div class="col-md-9 col-lg-10 main-content">
<div class="p-4">
<div class="row mb-4">
<div class="col-md-8">
<h1>Demandes pour {{ city.name }}</h1>
<p class="text-muted">
Code INSEE: {{ city.zone }}
</p>
</div>
<div class="col-md-4 text-end">
<a href="{{ path('app_public_rss_city_demandes', {'insee_code': city.zone}) }}" class="btn btn-warning" target="_blank">
<i class="bi bi-rss"></i> Flux RSS
</a>
</div>
</div>
<div class="card">
<div class="card-header">
<h2>
Liste des demandes ({{ demandes|length }})
</h2>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Nom du commerce</th>
<th>Date de création</th>
<th>Statut</th>
<th>Dernière tentative de contact</th>
{% if is_granted('ROLE_ADMIN') %}
<th>Actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for demande in demandes %}
<tr>
<td>{{ demande.id }}</td>
<td>{{ demande.query }}</td>
<td>{{ demande.createdAt ? demande.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>
<span class="badge
{% if demande.status == 'new' %}bg-primary
{% elseif demande.status == 'email_provided' %}bg-info
{% elseif demande.status == 'ready' %}bg-success
{% elseif demande.status == 'email_sent' %}bg-success
{% elseif demande.status == 'email_failed' %}bg-danger
{% elseif demande.status == 'email_opened' %}bg-warning
{% elseif demande.status == 'edit_form_opened' %}bg-warning
{% elseif demande.status == 'place_modified' %}bg-success
{% elseif demande.status == 'linked_to_place' %}bg-success
{% else %}bg-secondary{% endif %}">
{{ demande.status }}
</span>
</td>
<td>{{ demande.lastContactAttempt ? demande.lastContactAttempt|date('Y-m-d H:i:s') : '' }}</td>
{% if is_granted('ROLE_ADMIN') %}
<td>
<div class="btn-group" role="group">
<a href="{{ path('app_admin_demande_edit', {'id': demande.id}) }}" class="btn btn-sm btn-primary">
<i class="bi bi-pencil"></i> Éditer
</a>
{% if demande.place %}
<a href="{{ path('app_admin_demande_send_email', {'id': demande.id}) }}" class="btn btn-sm btn-success">
<i class="bi bi-envelope"></i> Envoyer un email
</a>
{% endif %}
</div>
</td>
{% endif %}
</tr>
{% else %}
<tr>
<td colspan="{% if is_granted('ROLE_ADMIN') %}6{% else %}5{% endif %}" class="text-center">Aucune demande trouvée pour cette ville</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="mt-4">
<p class="text-muted">
<i class="bi bi-info-circle"></i> Les demandes sont des requêtes de modification de commerces sur OpenStreetMap pour la ville de {{ city.name }}.
</p>
<p>
<a href="{{ path('app_public_cities') }}" class="btn btn-outline-secondary">
<i class="bi bi-arrow-left"></i> Retour à la liste des villes
</a>
</p>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View file

@ -162,7 +162,7 @@
<i class="bi bi-globe text-primary" style="font-size: 3rem;"></i>
</div>
<h3 class="card-title h5 fw-bold">Visibilité Maximale</h3>
<p class="card-text">Vos informations apparaîtront sur Google Maps, Apple Plans, Facebook et des
<p class="card-text">Vos informations apparaîtront sur TomTom, Apple Plans, Facebook, CoMaps et des
centaines d'autres applications.</p>
</div>
</div>
@ -175,8 +175,8 @@
<i class="bi bi-clock text-primary" style="font-size: 3rem;"></i>
</div>
<h3 class="card-title h5 fw-bold">Rapide et Simple</h3>
<p class="card-text">Mettez à jour vos horaires, contacts et services en quelques minutes
seulement.</p>
<p class="card-text">Mettez à jour vos horaires, contacts et services en quelques secondes
seulement, sans avoir à créer de compte.</p>
</div>
</div>
</div>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Mon Commerce OSM - Demandes pour {{ city.name }}</title>
<link>https://{{ base_url }}</link>
<description>Flux RSS des demandes de modification de commerces sur OpenStreetMap pour la ville de {{ city.name }}</description>
<language>fr-fr</language>
<pubDate>{{ "now"|date("D, d M Y H:i:s O") }}</pubDate>
<atom:link href="https://{{ base_url }}{{ path('app_public_rss_city_demandes', {'insee_code': city.zone}) }}" rel="self" type="application/rss+xml" />
{% for demande in demandes %}
<item>
<title>{{ demande.query }}</title>
<link>https://{{ base_url }}{{ path('app_admin_demande_edit', {'id': demande.id}) }}</link>
<guid>https://{{ base_url }}{{ path('app_admin_demande_edit', {'id': demande.id}) }}</guid>
<pubDate>{{ demande.createdAt|date("D, d M Y H:i:s O") }}</pubDate>
<description>
<![CDATA[
<p><strong>Nom du commerce:</strong> {{ demande.query }}</p>
{% if demande.email %}
<p><strong>Email:</strong> {{ demande.email }}</p>
{% endif %}
<p><strong>Statut:</strong> {{ demande.status }}</p>
<p><strong>Ville:</strong> {{ city.name }} ({{ city.zone }})</p>
{% if demande.lastContactAttempt %}
<p><strong>Dernière tentative de contact:</strong> {{ demande.lastContactAttempt|date("d/m/Y H:i:s") }}</p>
{% endif %}
]]>
</description>
</item>
{% endfor %}
</channel>
</rss>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Mon Commerce OSM - Changements thématiques pour {{ city.name }}</title>
<link>https://{{ base_url }}</link>
<description>Flux RSS des changements thématiques sur OpenStreetMap pour la ville de {{ city.name }}</description>
<language>fr-fr</language>
<pubDate>{{ "now"|date("D, d M Y H:i:s O") }}</pubDate>
<atom:link href="https://{{ base_url }}{{ path('app_public_rss_city_themes', {'insee_code': city.zone}) }}" rel="self" type="application/rss+xml" />
{% for theme, changes in themeChanges %}
{% if changes|length > 0 %}
{% set latestChange = changes[0] %}
<item>
<title>{{ followup_labels[theme]|default(theme|capitalize) }} - {{ latestChange.measure }} objets</title>
<link>https://{{ base_url }}{{ path('admin_followup_theme_graph', {'insee_code': city.zone, 'theme': theme}) }}</link>
<guid>https://{{ base_url }}{{ path('admin_followup_theme_graph', {'insee_code': city.zone, 'theme': theme}) }}/{{ latestChange.date|date('Y-m-d') }}</guid>
<pubDate>{{ latestChange.date|date("D, d M Y H:i:s O") }}</pubDate>
<description>
<![CDATA[
<p><strong>Thème:</strong> {{ followup_labels[theme]|default(theme|capitalize) }}</p>
<p><strong>Nombre d'objets:</strong> {{ latestChange.measure }}</p>
<p><strong>Date de mesure:</strong> {{ latestChange.date|date("d/m/Y H:i:s") }}</p>
<p><strong>Ville:</strong> {{ city.name }} ({{ city.zone }})</p>
{% if changes|length > 1 %}
<p><strong>Évolution:</strong>
{% set previousChange = changes[1] %}
{% set diff = latestChange.measure - previousChange.measure %}
{% if diff > 0 %}
<span style="color: green;">+{{ diff }} objets</span>
{% elseif diff < 0 %}
<span style="color: red;">{{ diff }} objets</span>
{% else %}
<span>Pas de changement</span>
{% endif %}
depuis le {{ previousChange.date|date("d/m/Y") }}
</p>
{% endif %}
]]>
</description>
</item>
{% endif %}
{% endfor %}
</channel>
</rss>

View file

@ -2,155 +2,171 @@
{% block title %}Évolutions des objets - {{ stats.name }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link href='{{ asset('css/city-sidebar.css') }}' rel='stylesheet' />
{% endblock %}
{% block body %}
<div class="container my-5">
<h1>Évolutions des objets à {{ stats.name }} ({{ stats.zone }})</h1>
<a href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}" class="btn btn-secondary mb-3"><i class="bi bi-arrow-left"></i> Retour aux stats</a>
<div class="card">
<div class="card-header">
<strong>Variation des décomptes d'objets par type</strong>
<div class="container-fluid">
<div class="row">
<!-- Sidebar de navigation -->
<div class="col-12">
{% include 'admin/_city_sidebar.html.twig' with {'stats': stats, 'active_menu': 'stats_evolutions'} %}
</div>
<div class="card-body">
<table class="table table-bordered table-striped table-hover table-responsive table-sort">
<thead>
<tr>
<th>Type</th>
<th class="text-end">Décompte actuel</th>
{% for p in periods %}
<th class="text-end">Évolution sur {{ p }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for type, evo in evolutions %}
<tr>
<td style="min-width: 15rem;">
<a href="{{ path('admin_followup_theme_graph', {'insee_code': stats.zone, 'theme': type}) }}" class="btn btn-outline-secondary btn-sm ms-2"
title="Voir le graphe détaillé">
<i class="bi bi-bar-chart"></i>
</a>
{{ tag_emoji(type) }} {{ type }}
</td>
<td class="text-end">{{ evo.now }}</td>
{% for p in periods %}
<td class="text-end{% if evo[p] is not null and evo[p] != 0 %} bg-success-subtle{% if evo[p] < 0 %} bg-danger-subtle{% endif %}{% endif %}">
{% if evo[p] is not null %}
{% if evo[p] > 0 %}
<i class="bi bi-arrow-up text-success"></i>
{% elseif evo[p] < 0 %}
<i class="bi bi-arrow-down text-danger"></i>
{% endif %}
{{ evo[p] > 0 ? '+' ~ evo[p] : evo[p] }}
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
{% endfor %}
</tr>
{% else %}
<tr><td colspan="5" class="text-muted">Aucune donnée d'évolution trouvée.</td></tr>
{% endfor %}
</tbody>
</table>
<!-- Contenu principal -->
<div class="col-md-9 col-lg-10 main-content">
<div class="p-4">
<h1>Évolutions des objets à {{ stats.name }} ({{ stats.zone }})</h1>
<div class="card">
<div class="card-header">
<strong>Variation des décomptes d'objets par type</strong>
</div>
<div class="card-body">
<table class="table table-bordered table-striped table-hover table-responsive table-sort">
<thead>
<tr>
<th>Type</th>
<th class="text-end">Décompte actuel</th>
{% for p in periods %}
<th class="text-end">Évolution sur {{ p }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for type, evo in evolutions %}
<tr>
<td style="min-width: 15rem;">
<a href="{{ path('admin_followup_theme_graph', {'insee_code': stats.zone, 'theme': type}) }}" class="btn btn-outline-secondary btn-sm ms-2"
title="Voir le graphe détaillé">
<i class="bi bi-bar-chart"></i>
</a>
{{ tag_emoji(type) }} {{ type }}
</td>
<td class="text-end">{{ evo.now }}</td>
{% for p in periods %}
<td class="text-end{% if evo[p] is not null and evo[p] != 0 %} bg-success-subtle{% if evo[p] < 0 %} bg-danger-subtle{% endif %}{% endif %}">
{% if evo[p] is not null %}
{% if evo[p] > 0 %}
<i class="bi bi-arrow-up text-success"></i>
{% elseif evo[p] < 0 %}
<i class="bi bi-arrow-down text-danger"></i>
{% endif %}
{{ evo[p] > 0 ? '+' ~ evo[p] : evo[p] }}
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
{% endfor %}
</tr>
{% else %}
<tr><td colspan="5" class="text-muted">Aucune donnée d'évolution trouvée.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row mt-5">
<div class="col-md-4">
<h3>Lieux modifiés cette semaine</h3>
{% if places_7j|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_7j %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 7 derniers jours.</p>
{% endif %}
</div>
<div class="col-md-4">
<h3>Ce mois-ci</h3>
{% if places_30j|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_30j %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 30 derniers jours.</p>
{% endif %}
</div>
<div class="col-md-4">
<h3>6 derniers mois</h3>
{% if places_6mois|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_6mois %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 6 derniers mois.</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-md-4">
<h3>Lieux modifiés cette semaine</h3>
{% if places_7j|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_7j %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 7 derniers jours.</p>
{% endif %}
</div>
<div class="col-md-4">
<h3>Ce mois-ci</h3>
{% if places_30j|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_30j %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 30 derniers jours.</p>
{% endif %}
</div>
<div class="col-md-4">
<h3>6 derniers mois</h3>
{% if places_6mois|length > 0 %}
<ul class="list-group mb-4">
{% for place in places_6mois %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<span>
<strong>
<a href="{{ path('app_public_edit', {'zipcode': place.zipCode, 'name': (place.name|default('sans-nom'))|url_encode, 'uuid': place.uuidForUrl}) }}">
{{ place.name ?: '(sans nom)' }}
</a>
</strong><br>
<small>
{% if place.street %}
<a href="{{ path('app_public_street', {'cityId': stats.zone, 'streetName': place.street|url_encode }) }}">{{ place.street }}</a>
{# {% else %}
<span class="text-muted">(inconnue)</span> #}
{% endif %}
{{ place.housenumber }}
</small>
</span>
<span>
<span class="badge bg-primary">{{ place.getModifiedDate() ? place.getModifiedDate()|date('Y-m-d H:i') : '' }}</span>
<a href="https://www.openstreetmap.org/{{ place.osmKind }}/{{ place.osmId }}" target="_blank" class="btn btn-outline-secondary btn-sm ms-2" title="Voir sur OSM"><i class="bi bi-globe"></i></a>
</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">Aucun lieu modifié dans les 6 derniers mois.</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% endblock %}