mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
up infos habitants sur stats
This commit is contained in:
parent
21d4d5b850
commit
918527e15e
16 changed files with 559 additions and 240 deletions
|
@ -37,6 +37,27 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% if stats.population %}
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4 col-12">
|
||||
<span class="badge bg-info">
|
||||
<i class="bi bi-people"></i> Population : {{ stats.population|number_format(0, '.', ' ') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-4 col-12">
|
||||
<span class="badge bg-secondary">
|
||||
<i class="bi bi-shop"></i> 1 lieu pour
|
||||
{% set ratio = (stats.population and stats.places|length > 0) ? (stats.population / stats.places|length)|round(0, 'ceil') : '?' %}
|
||||
{{ ratio|number_format(0, '.', ' ') }} habitants
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-4 col-12">
|
||||
<span class="badge bg-success">
|
||||
<i class="bi bi-pencil-square"></i> {{ stats.getAvecNote() }} / {{ stats.places|length }} commerces avec note
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-12">
|
||||
<span class="badge {% if stats.getCompletionPercent() > 85 %}bg-success{% else %}bg-warning{% endif %}">
|
||||
|
@ -198,28 +219,52 @@
|
|||
function calculateCompletion(element) {
|
||||
let completionCount = 0;
|
||||
let totalFields = 0;
|
||||
let missingFields = [];
|
||||
|
||||
const fieldsToCheck = [
|
||||
'name',
|
||||
'contact:street',
|
||||
'contact:housenumber',
|
||||
'opening_hours',
|
||||
'contact:website',
|
||||
'contact:phone',
|
||||
'wheelchair'
|
||||
{name: 'name', label: 'Nom du commerce'},
|
||||
{name: 'contact:street', label: 'Rue'},
|
||||
{name: 'contact:housenumber', label: 'Numéro'},
|
||||
{name: 'opening_hours', label: 'Horaires d\'ouverture'},
|
||||
{name: 'contact:website', label: 'Site web'},
|
||||
{name: 'contact:phone', label: 'Téléphone'},
|
||||
{name: 'wheelchair', label: 'Accessibilité PMR'}
|
||||
];
|
||||
|
||||
fieldsToCheck.forEach(field => {
|
||||
totalFields++;
|
||||
if (element.tags && element.tags[field]) {
|
||||
if (element.tags && element.tags[field.name]) {
|
||||
completionCount++;
|
||||
} else {
|
||||
missingFields.push(field.label);
|
||||
}
|
||||
});
|
||||
|
||||
return (completionCount / totalFields) * 100;
|
||||
return {
|
||||
percentage: (completionCount / totalFields) * 100,
|
||||
missingFields: missingFields
|
||||
};
|
||||
}
|
||||
|
||||
function showMissingFieldsPopup(element) {
|
||||
const completion = calculateCompletion(element);
|
||||
if (completion.percentage < 100) {
|
||||
const popup = new maplibregl.Popup()
|
||||
.setLngLat(element.geometry.coordinates)
|
||||
.setHTML(`
|
||||
<div class="p-2">
|
||||
<h5>Informations manquantes pour ${element.tags?.name || 'ce commerce'}</h5>
|
||||
<ul class="list-unstyled">
|
||||
${completion.missingFields.map(field => `<li><i class="bi bi-x-circle text-danger"></i> ${field}</li>`).join('')}
|
||||
</ul>
|
||||
</div>
|
||||
`);
|
||||
popup.addTo(map);
|
||||
}
|
||||
}
|
||||
|
||||
function createPopupContent(element) {
|
||||
const completion = calculateCompletion(element);
|
||||
let content = `
|
||||
<div class="mb-2">
|
||||
<a class="btn btn-primary" href="/admin/placeType/${element.type}/${element.id}">
|
||||
|
@ -231,6 +276,17 @@
|
|||
</div>
|
||||
`;
|
||||
|
||||
if (completion.percentage < 100) {
|
||||
content += `
|
||||
<div class="alert alert-warning mt-2">
|
||||
<h6>Informations manquantes :</h6>
|
||||
<ul class="list-unstyled mb-0">
|
||||
${completion.missingFields.map(field => `<li><i class="bi bi-x-circle text-danger"></i> ${field}</li>`).join('')}
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
content += '<table class="table table-sm">';
|
||||
|
||||
// Ajouter tous les tags
|
||||
|
@ -250,7 +306,7 @@
|
|||
|
||||
elements.forEach(element => {
|
||||
const completion = calculateCompletion(element);
|
||||
const bucketIndex = Math.floor(completion / 10);
|
||||
const bucketIndex = Math.floor(completion.percentage / 10);
|
||||
buckets[bucketIndex]++;
|
||||
});
|
||||
|
||||
|
@ -356,7 +412,7 @@
|
|||
properties: {
|
||||
id: element.id,
|
||||
name: element.tags?.name || 'Sans nom',
|
||||
completion: completion,
|
||||
completion: completion.percentage,
|
||||
center: [lon, lat]
|
||||
},
|
||||
geometry: {
|
||||
|
@ -400,86 +456,33 @@
|
|||
|
||||
function updateMarkers() {
|
||||
// Supprimer tous les marqueurs existants
|
||||
features.forEach(feature => {
|
||||
const layerId = `marker-${feature.properties.id}`;
|
||||
// Supprimer d'abord la couche
|
||||
if (map.getLayer(layerId)) {
|
||||
map.removeLayer(layerId);
|
||||
}
|
||||
// Puis supprimer la source
|
||||
if (map.getSource(layerId)) {
|
||||
map.removeSource(layerId);
|
||||
}
|
||||
});
|
||||
|
||||
// Supprimer tous les marqueurs en goutte existants
|
||||
dropMarkers.forEach(marker => marker.remove());
|
||||
dropMarkers = [];
|
||||
|
||||
if (currentMarkerType === 'circle') {
|
||||
// Afficher les cercles
|
||||
features.forEach(feature => {
|
||||
const layerId = `marker-${feature.properties.id}`;
|
||||
const circle = turf.circle(
|
||||
feature.properties.center,
|
||||
5/1000,
|
||||
{ steps: 64, units: 'kilometers' }
|
||||
);
|
||||
features.forEach(feature => {
|
||||
const el = document.createElement('div');
|
||||
el.className = 'marker';
|
||||
el.style.backgroundColor = getCompletionColor(feature.properties.completion);
|
||||
el.style.width = '15px';
|
||||
el.style.height = '15px';
|
||||
el.style.borderRadius = '50%';
|
||||
el.style.border = '2px solid white';
|
||||
el.style.cursor = 'pointer';
|
||||
|
||||
map.addSource(layerId, {
|
||||
'type': 'geojson',
|
||||
'data': circle
|
||||
});
|
||||
const marker = new maplibregl.Marker(el)
|
||||
.setLngLat(feature.geometry.coordinates)
|
||||
.addTo(map);
|
||||
|
||||
map.addLayer({
|
||||
'id': layerId,
|
||||
'type': 'fill',
|
||||
'source': layerId,
|
||||
'paint': {
|
||||
'fill-color': getCompletionColor(feature.properties.completion),
|
||||
'fill-opacity': 0.7
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Ajouter les popups sur les cercles
|
||||
map.on('click', function(e) {
|
||||
const clickedFeatures = map.queryRenderedFeatures(e.point, {
|
||||
layers: features.map(f => `marker-${f.properties.id}`)
|
||||
});
|
||||
|
||||
if (clickedFeatures.length > 0) {
|
||||
const feature = clickedFeatures[0];
|
||||
const elementId = feature.layer.id.replace('marker-', '');
|
||||
const element = overpassData[elementId];
|
||||
|
||||
if (element) {
|
||||
// Créer le contenu de la popup
|
||||
const popupContent = createPopupContent(element);
|
||||
|
||||
new maplibregl.Popup()
|
||||
.setLngLat(e.lngLat)
|
||||
.setHTML(popupContent)
|
||||
.addTo(map);
|
||||
}
|
||||
// Ajouter l'événement de clic
|
||||
el.addEventListener('click', () => {
|
||||
const element = overpassData[feature.properties.id];
|
||||
if (element) {
|
||||
showMissingFieldsPopup(element);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Afficher les marqueurs en goutte
|
||||
features.forEach(feature => {
|
||||
const element = overpassData[feature.properties.id];
|
||||
const popupContent = element ? createPopupContent(element) : `<h1>${feature.properties.name}</h1>`;
|
||||
|
||||
const marker = new maplibregl.Marker({
|
||||
color: getCompletionColor(feature.properties.completion)
|
||||
})
|
||||
.setLngLat(feature.properties.center)
|
||||
.setPopup(new maplibregl.Popup({ offset: 25 })
|
||||
.setHTML(popupContent))
|
||||
.addTo(map);
|
||||
dropMarkers.push(marker);
|
||||
});
|
||||
}
|
||||
|
||||
dropMarkers.push(marker);
|
||||
});
|
||||
}
|
||||
|
||||
function draw_circle_containing_all_features(map) {
|
||||
|
@ -722,6 +725,40 @@
|
|||
});
|
||||
|
||||
sortTable();
|
||||
|
||||
// Initialiser les popovers pour les cellules de complétion
|
||||
const completionCells = document.querySelectorAll('.completion-cell');
|
||||
completionCells.forEach(cell => {
|
||||
new bootstrap.Popover(cell, {
|
||||
trigger: 'hover',
|
||||
html: true
|
||||
});
|
||||
|
||||
// Fermer tous les popovers au clic sur une cellule
|
||||
cell.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
completionCells.forEach(otherCell => {
|
||||
if (otherCell !== cell) {
|
||||
const popover = bootstrap.Popover.getInstance(otherCell);
|
||||
if (popover) {
|
||||
popover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Fermer tous les popovers quand on clique ailleurs
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!e.target.closest('.completion-cell')) {
|
||||
completionCells.forEach(cell => {
|
||||
const popover = bootstrap.Popover.getInstance(cell);
|
||||
if (popover) {
|
||||
popover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function toggleCompletionInfo() {
|
||||
|
|
|
@ -10,7 +10,37 @@
|
|||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-right" style="background : rgba(0,255,0,{{ commerce.getCompletionPercentage() / 100 }})">
|
||||
<td class="text-right completion-cell"
|
||||
style="background : rgba(0,255,0,{{ commerce.getCompletionPercentage() / 100 }})"
|
||||
data-bs-toggle="popover"
|
||||
data-bs-trigger="hover"
|
||||
data-bs-html="true"
|
||||
data-bs-content="
|
||||
<div class='p-2'>
|
||||
<h6>Informations manquantes :</h6>
|
||||
<ul class='list-unstyled mb-0'>
|
||||
{% if not commerce.name %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Nom du commerce</li>
|
||||
{% endif %}
|
||||
{% if not commerce.hasAddress() %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Adresse complète</li>
|
||||
{% endif %}
|
||||
{% if not commerce.hasOpeningHours() %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Horaires d'ouverture</li>
|
||||
{% endif %}
|
||||
{% if not commerce.hasWebsite() %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Site web</li>
|
||||
{% endif %}
|
||||
{# {% if not commerce.phone %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Téléphone</li>
|
||||
{% endif %} #}
|
||||
{% if not commerce.hasWheelchair() %}
|
||||
<li><i class='bi bi-x-circle text-danger'></i> Accessibilité PMR</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
"
|
||||
>
|
||||
{{ commerce.getCompletionPercentage() }}
|
||||
</td>
|
||||
<td class="{{ commerce.mainTag ? 'filled' : '' }}">
|
||||
|
|
|
@ -53,9 +53,21 @@
|
|||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src='{{ asset('js/maplibre/maplibre-gl.js') }}'></script>
|
||||
<script src="{{ asset('js/utils.js') }}"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import { colorizePercentageCells, setupCitySearch, getLabourerUrl, handleAddCityFormSubmit, colorizePercentageCellsRelative } from '{{ asset('js/utils.js') }}';
|
||||
|
||||
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');
|
||||
|
||||
const searchInput = document.getElementById('citySearch');
|
||||
const suggestionList = document.getElementById('citySuggestions');
|
||||
|
||||
|
@ -64,6 +76,30 @@
|
|||
document.getElementById('selectedZipCode').value = suggestion.postcode;
|
||||
});
|
||||
}
|
||||
|
||||
// Attacher le submit du formulaire en JS
|
||||
const labourerForm = document.getElementById('labourerForm');
|
||||
if (labourerForm) {
|
||||
labourerForm.addEventListener('submit', handleAddCityFormSubmit);
|
||||
}
|
||||
|
||||
// Gestionnaire pour les boutons de labourage
|
||||
document.querySelectorAll('.btn-labourer').forEach(button => {
|
||||
button.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
console.log('submit', this.dataset);
|
||||
const zipCode = this.dataset.zipCode;
|
||||
if (!zipCode) return;
|
||||
|
||||
// Désactiver le bouton et ajouter le spinner
|
||||
this.disabled = true;
|
||||
const originalContent = this.innerHTML;
|
||||
this.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Labourer...';
|
||||
|
||||
// Rediriger vers l'URL de labourage
|
||||
window.location.href = getLabourerUrl(zipCode);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -77,28 +113,6 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Labourer une ville</h3>
|
||||
<form id="labourerForm" onsubmit="handleAddCityFormSubmit(event)">
|
||||
<div class="search-container">
|
||||
<input type="text"
|
||||
id="citySearch"
|
||||
class="form-control"
|
||||
placeholder="Rechercher une ville..."
|
||||
autocomplete="off">
|
||||
<div id="citySuggestions" class="suggestion-list"></div>
|
||||
</div>
|
||||
<input type="hidden" name="zip_code" id="selectedZipCode">
|
||||
<button type="submit" class="btn btn-primary mt-3">Labourer cette ville</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<h2>Statistiques par ville</h2>
|
||||
<div class="table-responsive">
|
||||
|
@ -115,12 +129,32 @@
|
|||
<tbody>
|
||||
{% for stat in stats %}
|
||||
<tr>
|
||||
<td>{{ stat.name }}</td>
|
||||
<td><a href="{{ path('app_admin_stats', {'zip_code': stat.zone}) }}" title="Voir les statistiques de cette ville">
|
||||
{{ stat.name }}
|
||||
</a></td>
|
||||
<td>{{ stat.zone }}</td>
|
||||
<td>{{ stat.completionPercent }}%</td>
|
||||
<td>{{ stat.places|length }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': stat.zone}) }}" class="btn btn-sm btn-primary">Voir les statistiques</a>
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': stat.zone}) }}" class="btn btn-sm btn-primary" title="Voir les statistiques de cette ville">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a href="{{ path('app_admin_labourer', {'zip_code': stat.zone}) }}"
|
||||
class="btn btn-sm btn-success btn-labourer"
|
||||
data-zip-code="{{ stat.zone }}"
|
||||
title="Labourer cette ville"
|
||||
>
|
||||
<i class="bi bi-recycle"></i>
|
||||
</a>
|
||||
<a href="{{ path('app_admin_delete_by_zone', {'zip_code': stat.zone}) }}"
|
||||
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>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -129,5 +163,35 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Labourer une ville</h3>
|
||||
<p class="card-text">
|
||||
<i class="bi bi-info-circle"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="right"
|
||||
data-bs-html="true"
|
||||
title="<strong>Qu'est-ce que le labourage ?</strong><br><br>Le labourage consiste à rechercher automatiquement tous les commerces et lieux d'intérêt dans une ville sur OpenStreetMap. Cette action permet de :<br><br>- Découvrir les commerces existants<br>- Mesurer leur taux de complétion<br>- Identifier les informations manquantes<br>- Faciliter la mise à jour des données"></i>
|
||||
Rechercher une ville pour labourer ses commerces
|
||||
</p>
|
||||
<form id="labourerForm">
|
||||
<div class="search-container">
|
||||
<input type="text"
|
||||
id="citySearch"
|
||||
class="form-control"
|
||||
placeholder="Rechercher une ville..."
|
||||
autocomplete="off">
|
||||
<div id="citySuggestions" class="suggestion-list"></div>
|
||||
</div>
|
||||
<input type="hidden" name="zip_code" id="selectedZipCode">
|
||||
<button type="submit" class="btn btn-primary mt-3 btn-labourer">Labourer cette ville</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
{% block body %}
|
||||
<div class="container edit-land mt-4">
|
||||
<div class="container edit-land mt-4" id="editLand">
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
|
@ -15,7 +15,7 @@
|
|||
{% if commerce_overpass is not empty %}
|
||||
<form action="{{ path('app_public_submit', {'osm_object_id': commerce_overpass['@attributes'].id, 'version': commerce_overpass['@attributes'].version, 'changesetID': commerce_overpass['@attributes'].changeset }) }}" method="post" class="needs-validation">
|
||||
<input type="hidden" name="osm_kind" value="{{ osm_kind }}">
|
||||
{# nom #}
|
||||
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-12 col-md-4">
|
||||
<label for="commerce_tag_value__name" class="form-label">{{'display.keys.name'|trans}}</label>
|
||||
|
@ -86,13 +86,10 @@
|
|||
<hr>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 mt-4">
|
||||
<div class="actions-modification mb-4 mx-2">
|
||||
|
@ -126,17 +123,20 @@
|
|||
{{ 'display.by'|trans }}
|
||||
<a href="https://www.openstreetmap.org/user/{{ commerce_overpass['@attributes'].user }}" >{{ commerce_overpass['@attributes'].user }}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="lien-OpenStreetMap">
|
||||
<a href="https://www.openstreetmap.org/{{commerce.osmKind}}/{{ commerce_overpass['@attributes'].id }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-globe"></i> {{ 'display.view_on_osm'|trans }}
|
||||
{{ asset('img/logo-osm.png') }}
|
||||
</a>
|
||||
<button onclick="openInJOSM('{{commerce.osmKind}}', '{{ commerce_overpass['@attributes'].id }}')" class="btn btn-outline-secondary ms-2">
|
||||
<i class="bi bi-pencil"></i> Éditer dans JOSM
|
||||
<button onclick="openInJOSM('{{commerce.osmKind}}', '{{ commerce_overpass['@attributes'].id }}')"
|
||||
title="Ouvrir dans JOSM"
|
||||
class="btn btn-outline-secondary ms-2">
|
||||
<i class="bi bi-pencil"></i>
|
||||
{{ asset('img/josm.png') }}
|
||||
</button>
|
||||
<button onclick="openInPanoramax()" class="btn btn-outline-secondary ms-2">
|
||||
<i class="bi bi-camera"></i> Voir dans Panoramax
|
||||
<button onclick="openInPanoramax()" title="Ouvrir dans Panoramax" class="btn btn-outline-secondary ms-2">
|
||||
<i class="bi bi-camera"></i>
|
||||
{{ asset('img/logo-panoramax.png') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -55,6 +55,14 @@
|
|||
position: relative;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.list-group-item{
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
.list-group-item:hover{
|
||||
background-color: #f5f5f5;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -94,29 +102,24 @@
|
|||
<div class="row city-list ">
|
||||
|
||||
<div class="mt-5">
|
||||
<h2><i class="bi bi-geo-alt"></i> Villes disponibles</h2>
|
||||
<p>Visualisez un tableau de bord de la complétion des commerces et autres lieux d'intérêt pour votre ville grâce à OpenStreetMap</p>
|
||||
<h2><i class="bi bi-geo-alt"></i> Villes disponibles</h2>
|
||||
<p>Visualisez un tableau de bord de la complétion des commerces et autres lieux d'intérêt pour votre ville grâce à OpenStreetMap</p>
|
||||
|
||||
</div>
|
||||
|
||||
{% for stat in stats %}
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': stat.zone}) }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex flex-column">
|
||||
<span class="zone">{{ stat.zone }}</span>
|
||||
<span class="name">{{ stat.name }}</span>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="list-group">
|
||||
{% for stat in stats %}
|
||||
<a href="{{ path('app_admin_stats', {'zip_code': stat.zone}) }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
|
||||
{{ stat.zone }} {{ stat.name }}
|
||||
<span class="badge bg-primary rounded-pill">{{ stat.placesCount }} commerces</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
Ajoutez votre ville
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="badge bg-primary rounded-pill">{{ stat.placesCount }} lieux</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// Créer le formulaire email
|
||||
|
@ -223,3 +226,13 @@
|
|||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script type="module">
|
||||
import { adjustListGroupFontSize } from '{{ asset('js/utils.js') }}';
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
adjustListGroupFontSize('.list-group-item');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue