mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
linking demandes
This commit is contained in:
parent
0aa050b38b
commit
7f79ec3a9f
6 changed files with 190 additions and 10 deletions
|
@ -96,6 +96,7 @@
|
|||
<th>Email</th>
|
||||
<th>Date de création</th>
|
||||
<th>Statut</th>
|
||||
<th>OSM</th>
|
||||
<th>Place UUID</th>
|
||||
<th>Dernière tentative de contact</th>
|
||||
<th>Actions</th>
|
||||
|
@ -105,7 +106,15 @@
|
|||
{% for demande in demandes %}
|
||||
<tr>
|
||||
<td>{{ demande.id }}</td>
|
||||
<td>{{ demande.query }}</td>
|
||||
<td>
|
||||
{% if demande.placeUuid and demande.osmObjectType and demande.osmId %}
|
||||
<a href="{{ path('app_public_edit_by_osm', {'osm_kind': demande.osmObjectType, 'osm_id': demande.osmId}) }}" title="Éditer la place">
|
||||
{{ demande.query }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ demande.query }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ demande.email }}</td>
|
||||
<td>{{ demande.createdAt ? demande.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
|
@ -123,7 +132,28 @@
|
|||
{{ demande.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ demande.placeUuid }}</td>
|
||||
<td>
|
||||
{% if demande.osmObjectType and demande.osmId %}
|
||||
<a href="https://www.openstreetmap.org/{{ demande.osmObjectType }}/{{ demande.osmId }}" target="_blank" title="Voir sur OpenStreetMap">
|
||||
<i class="bi bi-globe"></i> {{ demande.osmObjectType }}/{{ demande.osmId }}
|
||||
</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if demande.placeUuid %}
|
||||
{% if demande.osmObjectType and demande.osmId %}
|
||||
<a href="{{ path('app_public_edit_by_osm', {'osm_kind': demande.osmObjectType, 'osm_id': demande.osmId}) }}" title="Éditer la place">
|
||||
{{ demande.placeUuid }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ demande.placeUuid }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ demande.placeUuid }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ demande.lastContactAttempt ? demande.lastContactAttempt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
<div class="btn-group" role="group">
|
||||
|
@ -140,7 +170,7 @@
|
|||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">Aucune demande trouvée</td>
|
||||
<td colspan="9" class="text-center">Aucune demande trouvée</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -508,18 +508,21 @@
|
|||
|
||||
// Mettre à jour les statistiques
|
||||
function updateStats() {
|
||||
if (countData.length > 0) {
|
||||
if (Array.isArray(countData) && countData.length > 0) {
|
||||
const latestCount = countData[countData.length - 1];
|
||||
document.getElementById('currentCount').textContent = latestCount.value;
|
||||
document.getElementById('lastUpdate').textContent = new Date(latestCount.date).toLocaleDateString('fr-FR');
|
||||
}
|
||||
|
||||
if (completionData.length > 0) {
|
||||
if (Array.isArray(completionData) && completionData.length > 0) {
|
||||
const latestCompletion = completionData[completionData.length - 1];
|
||||
document.getElementById('currentCompletion').textContent = latestCompletion.value + '%';
|
||||
}
|
||||
|
||||
document.getElementById('dataPoints').textContent = Math.max(countData.length, completionData.length);
|
||||
document.getElementById('dataPoints').textContent = Math.max(
|
||||
Array.isArray(countData) ? countData.length : 0,
|
||||
Array.isArray(completionData) ? completionData.length : 0
|
||||
);
|
||||
}
|
||||
|
||||
// Configuration commune pour les graphiques
|
||||
|
@ -571,7 +574,7 @@
|
|||
datasets: [
|
||||
{
|
||||
label: "Nombre d'objets",
|
||||
data: countData?.map(d => ({ x: new Date(d.date), y: d.value })),
|
||||
data: Array.isArray(countData) ? countData.map(d => ({ x: new Date(d.date), y: d.value })) : [],
|
||||
borderColor: '#0d6efd',
|
||||
backgroundColor: 'rgba(13, 110, 253, 0.1)',
|
||||
borderWidth: 2,
|
||||
|
@ -581,7 +584,7 @@
|
|||
},
|
||||
{
|
||||
label: 'Pourcentage de complétion',
|
||||
data: completionData?.map(d => ({ x: new Date(d.date), y: d.value })),
|
||||
data: Array.isArray(completionData) ? completionData.map(d => ({ x: new Date(d.date), y: d.value })) : [],
|
||||
borderColor: '#198754',
|
||||
backgroundColor: 'rgba(25, 135, 84, 0.1)',
|
||||
borderWidth: 2,
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<th>Nom du commerce</th>
|
||||
<th>Date de création</th>
|
||||
<th>Statut</th>
|
||||
<th>OSM</th>
|
||||
<th>Dernière tentative de contact</th>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<th>Actions</th>
|
||||
|
@ -74,6 +75,21 @@
|
|||
{{ demande.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{% if demande.osmObjectType and demande.osmId %}
|
||||
<a href="https://www.openstreetmap.org/{{ demande.osmObjectType }}/{{ demande.osmId }}" target="_blank" title="Voir sur OpenStreetMap">
|
||||
<i class="bi bi-globe"></i> {{ demande.osmObjectType }}/{{ demande.osmId }}
|
||||
</a>
|
||||
{% if demande.placeUuid %}
|
||||
<br>
|
||||
<a href="{{ path('app_public_edit_by_osm', {'osm_kind': demande.osmObjectType, 'osm_id': demande.osmId}) }}" title="Éditer la place">
|
||||
<i class="bi bi-pencil-square"></i> Éditer
|
||||
</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ demande.lastContactAttempt ? demande.lastContactAttempt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<td>
|
||||
|
@ -92,7 +108,7 @@
|
|||
</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>
|
||||
<td colspan="{% if is_granted('ROLE_ADMIN') %}7{% else %}6{% endif %}" class="text-center">Aucune demande trouvée pour cette ville</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue