panel latéral sur graphe avancé

This commit is contained in:
Tykayn 2025-07-16 17:34:13 +02:00 committed by tykayn
parent 2e459122b5
commit 0aa050b38b
3 changed files with 74 additions and 36 deletions

View file

@ -2,9 +2,23 @@
{% block title %}Suivi des objets OSM - {{ stats.name }}{% endblock %}
{% block stylesheets %}
{{ parent() }}
<link href='{{ asset('css/city-sidebar.css') }}' rel='stylesheet' />
{% endblock %}
{% block body %}
<div class="container mt-4">
<h1>Suivi des objets OSM pour {{ stats.name }} ({{ stats.zone }})</h1>
<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': 'followup_graph'} %}
</div>
<!-- Contenu principal -->
<div class="col-md-9 col-lg-10 main-content">
<div class="p-4">
<h1>Suivi des objets OSM pour {{ stats.name }} ({{ stats.zone }})</h1>
<div class="mb-3 d-flex flex-wrap gap-2">
<a href="{{ path('admin_followup', {'insee_code': stats.zone}) }}" class="btn btn-warning">
<i class="bi bi-arrow-repeat"></i> Mettre à jour les suivis (followup)
@ -114,7 +128,7 @@
</tbody>
</table>
</div>
{% for type, label in followup_labels %}
<h2 id="title-{{ type }}"><i class="bi {{ followup_icons[type]|default('bi-question-circle') }} fs-2"></i> {{ label }}</h2>
<canvas id="{{ type }}Chart" width="600" height="400"></canvas>
@ -136,10 +150,10 @@
'all_types': [type]
} %}
{% endfor %}
<h2 class="mt-4">Évolution du taux de complétion (CTC - Complète tes commerces)</h2>
<canvas id="ctcCompletionChart" width="900" height="400"></canvas>
<h2 class="mt-4">Données brutes</h2>
<table class="table table-bordered table-striped">
<thead>
@ -162,6 +176,9 @@
</tbody>
</table>
<a href="{{ path('app_admin_stats', {'insee_code': stats.zone}) }}" class="btn btn-secondary mt-3"><i class="bi bi-arrow-left"></i> Retour à la fiche ville</a>
</div>
</div>
</div>
</div>
{% endblock %}
@ -270,7 +287,7 @@
canvas.parentNode.insertBefore(dateDiv, canvas.nextSibling);
}
});
// --- Graphique séparé pour les données CTC ---
if (Object.keys(ctcCompletionSeries).length > 0) {
const ctcDatasets = Object.keys(ctcCompletionSeries).map(function(type) {
@ -320,4 +337,4 @@
}
});
</script>
{% endblock %}
{% endblock %}