2025-05-26 11:32:53 +02:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
2025-06-03 10:52:15 +02:00
|
|
|
{% block title %}Tableau de bord{% endblock %}
|
2025-05-26 11:32:53 +02:00
|
|
|
|
|
|
|
{% block stylesheets %}
|
|
|
|
{{ parent() }}
|
2025-06-03 14:58:23 +02:00
|
|
|
<link href='{{ asset('js/maplibre/maplibre-gl.css') }}' rel='stylesheet' />
|
2025-05-26 11:32:53 +02:00
|
|
|
<style>
|
|
|
|
.hidden {
|
|
|
|
display: none;
|
|
|
|
}
|
2025-06-01 19:52:56 +02:00
|
|
|
#mapDashboard {
|
|
|
|
height: 400px;
|
|
|
|
width: 100%;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
2025-06-17 13:23:47 +02:00
|
|
|
.suggestion-list {
|
2025-06-03 12:51:20 +02:00
|
|
|
position: absolute;
|
|
|
|
background: white;
|
2025-06-17 13:23:47 +02:00
|
|
|
border: 1px solid #ddd;
|
|
|
|
border-radius: 4px;
|
|
|
|
max-height: 200px;
|
|
|
|
overflow-y: auto;
|
2025-06-03 12:51:20 +02:00
|
|
|
width: 100%;
|
|
|
|
z-index: 1000;
|
2025-05-28 17:05:34 +02:00
|
|
|
}
|
2025-06-17 13:23:47 +02:00
|
|
|
.suggestion-item {
|
|
|
|
padding: 8px 12px;
|
|
|
|
cursor: pointer;
|
|
|
|
border-bottom: 1px solid #eee;
|
2025-06-01 20:08:57 +02:00
|
|
|
}
|
2025-06-17 13:23:47 +02:00
|
|
|
.suggestion-item:hover {
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
}
|
|
|
|
.suggestion-name {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.suggestion-details {
|
|
|
|
font-size: 0.9em;
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
.suggestion-type {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
|
|
|
.search-container {
|
|
|
|
position: relative;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
{% endblock %}
|
2025-06-01 20:08:57 +02:00
|
|
|
|
2025-05-28 17:05:34 +02:00
|
|
|
|
2025-05-26 11:32:53 +02:00
|
|
|
{% block body %}
|
2025-06-17 13:23:47 +02:00
|
|
|
<div class="container">
|
2025-05-26 11:32:53 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12">
|
2025-06-17 13:23:47 +02:00
|
|
|
<h1 class="mb-4">Tableau de bord</h1>
|
2025-05-26 11:32:53 +02:00
|
|
|
</div>
|
2025-06-17 13:23:47 +02:00
|
|
|
</div>
|
2025-06-05 15:43:11 +02:00
|
|
|
|
2025-06-17 13:23:47 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12">
|
|
|
|
<h2>Statistiques par ville</h2>
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Ville</th>
|
|
|
|
<th>Code postal</th>
|
|
|
|
<th>Complétion</th>
|
|
|
|
<th>Nombre de commerces</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for stat in stats %}
|
|
|
|
<tr>
|
2025-06-17 18:27:19 +02:00
|
|
|
<td><a href="{{ path('app_admin_stats', {'insee_code': stat.zone}) }}" title="Voir les statistiques de cette ville">
|
2025-06-17 16:23:29 +02:00
|
|
|
{{ stat.name }}
|
2025-06-17 18:27:19 +02:00
|
|
|
{% if not stat.name and stat.zone starts with '751' %}
|
|
|
|
Paris {{ stat.zone|slice(-2) }}e.
|
|
|
|
|
|
|
|
{% endif %}
|
2025-06-17 16:23:29 +02:00
|
|
|
</a></td>
|
2025-06-17 13:23:47 +02:00
|
|
|
<td>{{ stat.zone }}</td>
|
|
|
|
<td>{{ stat.completionPercent }}%</td>
|
|
|
|
<td>{{ stat.places|length }}</td>
|
|
|
|
<td>
|
2025-06-17 16:23:29 +02:00
|
|
|
<div class="btn-group" role="group">
|
2025-06-17 18:27:19 +02:00
|
|
|
<a href="{{ path('app_admin_stats', {'insee_code': stat.zone}) }}" class="btn btn-sm btn-primary" title="Voir les statistiques de cette ville">
|
2025-06-17 16:23:29 +02:00
|
|
|
<i class="bi bi-eye"></i>
|
|
|
|
</a>
|
2025-06-17 18:27:19 +02:00
|
|
|
<a href="{{ path('app_admin_labourer', {'insee_code': stat.zone}) }}"
|
2025-06-17 16:23:29 +02:00
|
|
|
class="btn btn-sm btn-success btn-labourer"
|
|
|
|
data-zip-code="{{ stat.zone }}"
|
|
|
|
title="Labourer cette ville"
|
|
|
|
>
|
|
|
|
<i class="bi bi-recycle"></i>
|
|
|
|
</a>
|
2025-06-17 18:27:19 +02:00
|
|
|
<a href="{{ path('app_admin_delete_by_zone', {'insee_code': stat.zone}) }}"
|
2025-06-17 16:23:29 +02:00
|
|
|
class="btn btn-sm btn-danger"
|
|
|
|
onclick="return confirm('Êtes-vous sûr de vouloir supprimer cette zone ?')"
|
|
|
|
title="Supprimer cette ville"
|
|
|
|
>
|
|
|
|
<i class="bi bi-trash"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
2025-06-17 13:23:47 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-05-26 11:32:53 +02:00
|
|
|
</div>
|
2025-06-17 16:23:29 +02:00
|
|
|
|
2025-06-18 00:41:24 +02:00
|
|
|
{% include 'public/labourage-form.html.twig' %}
|
2025-05-26 11:32:53 +02:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|
2025-06-18 00:41:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
{% block javascripts %}
|
|
|
|
{{ parent() }}
|
|
|
|
<script src='{{ asset('js/maplibre/maplibre-gl.js') }}'></script>
|
|
|
|
<script src='{{ asset('js/utils.js') }}'></script>
|
|
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
// Initialiser les tooltips Bootstrap
|
|
|
|
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
|
|
|
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
|
|
|
return new bootstrap.Tooltip(tooltipTriggerEl)
|
|
|
|
});
|
|
|
|
|
|
|
|
// Colorer les cellules de pourcentage
|
|
|
|
colorizePercentageCells('td:nth-child(3)');
|
|
|
|
// colorier selon le nombre de lieux
|
|
|
|
colorizePercentageCellsRelative('td:nth-child(4)', '154, 205, 50');
|
|
|
|
|
|
|
|
enableLabourageForm();
|
|
|
|
performSearch('dieppe');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|