2025-05-26 11:32:53 +02:00
{% extends 'base.html.twig' %}
{% block title %} Hello PublicController! {% endblock %}
{% block stylesheets %}
{{ parent ( ) }}
<link href='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css' rel='stylesheet' />
<style>
.hidden {
display: none;
}
</style>
{% endblock %}
2025-05-28 17:05:34 +02:00
{% block javascripts %}
{{ parent ( ) }}
<script>
function labourer() {
window.location.href = '/admin/labourer/' + document.getElementById('app_admin_labourer').value;
}
</script>
{% endblock %}
2025-05-26 11:32:53 +02:00
{% block body %}
<div class="container mt-4">
<div class="row">
<div class="col-12">
<h1>Dashboard</h1>
</div>
<div class="col-12">
<h2>Statistiques : {{ stats | length }} commerces</h2>
2025-05-28 17:05:34 +02:00
<input class="form-control" type="text" id="app_admin_labourer" value="75013">
<button class="btn btn-default" onclick="labourer() ">Labourer</button>
2025-05-27 12:17:46 +02:00
<table class="table table-hover table-striped table-responsive">
2025-05-26 11:32:53 +02:00
<thead>
<tr>
<th>Zone</th>
<th>Nombre de commerces</th>
<th>Complétude %</th>
2025-05-28 16:24:34 +02:00
<th>Actions</th>
2025-05-26 11:32:53 +02:00
</tr>
</thead>
<tbody>
{% for stat in stats %}
<tr>
2025-05-28 16:24:34 +02:00
<td>
<a href=" {{ path ( 'app_admin_stats' , { 'zip_code' : stat .zone } ) }} "> {{ stat .zone }} </a>
</td>
2025-05-26 11:32:53 +02:00
<td> {{ stat .placesCount }} </td>
<td style="background : rgba(0 , 255, 0, {{ stat .completionPercent / 1 0 0 }} )"> {{ stat .completionPercent }} </td>
2025-05-28 16:24:34 +02:00
<td>
<a class="btn btn-sm btn-primary" href=" {{ path ( 'app_admin_stats' , { 'zip_code' : stat .zone } ) }} "><i class="bi bi-eye"></i></a>
<a class="btn btn-sm btn-warning" href=" {{ path ( 'app_admin_labourer' , { 'zip_code' : stat .zone } ) }} "><i class="bi bi-arrow-repeat"></i></a>
<a class="btn btn-sm btn-danger" href=" {{ path ( 'app_admin_delete_by_zone' , { 'zip_code' : stat .zone } ) }} "><i class="bi bi-trash"></i></a>
</td>
2025-05-26 11:32:53 +02:00
</tr>
{% endfor %}
</tbody>
</table>
<h2>Lieux</h2>
2025-05-27 12:17:46 +02:00
<table class="table table-striped table-hover table-responsive">
2025-05-26 11:32:53 +02:00
<thead>
<tr>
<th>Nom</th>
<th>Email</th>
<th>Date de modification</th>
<th>Date de dernier contact</th>
2025-05-26 12:57:10 +02:00
<th>Date de dernière modification</th>
<th>Code postal</th>
2025-05-28 16:24:34 +02:00
<th>Actions</th>
2025-05-26 12:57:10 +02:00
2025-05-26 11:32:53 +02:00
</tr>
</thead>
<tbody>
{% for place in places %}
<tr>
2025-05-28 16:24:34 +02:00
<td> {% if place .name %}
<a href=" {{ path ( 'app_public_edit' , { 'zipcode' : place .zipCode , 'name' : place .name , 'uuid' : place .uuidForUrl } ) }} "> {{ place .name }} </a>
{% else %}
<a href=" {{ path ( 'app_public_edit' , { 'zipcode' : place .zipCode , 'name' : '?' , 'uuid' : place .uuidForUrl } ) }} "><i class="bi bi-question-circle"></i></a>
{% endif %} </td>
2025-05-26 11:32:53 +02:00
<td> {{ place .email }} </td>
<td> {{ place .modifiedDate | date ( 'Y-m-d H:i:s' ) }} </td>
<td> {{ place .lastContactAttemptDate | date ( 'Y-m-d H:i:s' ) }} </td>
<td> {{ place .modifiedDate | date ( 'Y-m-d H:i:s' ) }} </td>
2025-05-26 12:57:10 +02:00
<td> {{ place .zipCode }} </td>
<td>
2025-05-28 16:24:34 +02:00
<a href="https://www.openstreetmap.org/ {{ place .osmKind }} / {{ place .osmId }} " target="_blank"><i class="bi bi-globe"></i></a>
2025-05-26 12:57:10 +02:00
{% if place .name %}
2025-05-28 16:24:34 +02:00
<a href=" {{ path ( 'app_public_edit' , { 'zipcode' : place .zipCode , 'name' : place .name , 'uuid' : place .uuidForUrl } ) }} "><i class="bi bi-pencil"></i></a>
2025-05-26 12:57:10 +02:00
{% else %}
2025-05-28 16:24:34 +02:00
<a href=" {{ path ( 'app_public_edit' , { 'zipcode' : place .zipCode , 'name' : '?' , 'uuid' : place .uuidForUrl } ) }} "><i class="bi bi-pencil"></i></a>
2025-05-26 12:57:10 +02:00
{% endif %}
2025-05-28 16:24:34 +02:00
<a href=" {{ path ( 'app_admin_delete' , { 'id' : place .id } ) }} " onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce lieu ?')"><i class="bi bi-trash"></i></a>
2025-05-26 12:57:10 +02:00
</td>
2025-05-26 11:32:53 +02:00
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}