mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
conteneur de tableau long
This commit is contained in:
parent
f50f2f87f5
commit
2ea7f7711f
3 changed files with 148 additions and 106 deletions
|
@ -163,4 +163,11 @@ img {
|
||||||
table tbody {
|
table tbody {
|
||||||
max-height: 700px;
|
max-height: 700px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#table_container, .table-container, #table-container{
|
||||||
|
max-height: 700px;
|
||||||
|
overflow: auto;
|
||||||
|
display: block;
|
||||||
|
border: solid 3px rgb(255, 255, 255);
|
||||||
}
|
}
|
|
@ -208,8 +208,35 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{# <input type="text" id="stats-table-search" class="form-control mb-2" placeholder="Filtrer les lieux..."> #}
|
<div id="table-container">
|
||||||
<table id="stats-table" class="table table-bordered table-striped table-hover table-responsive table-sort">
|
<div class="row mb-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text">
|
||||||
|
<i class="bi bi-search"></i>
|
||||||
|
</span>
|
||||||
|
<input type="text" id="stats-table-search" class="form-control" placeholder="Filtrer les lieux...">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="d-flex justify-content-end">
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-outline-secondary" id="export-selected">
|
||||||
|
<i class="bi bi-download"></i> Exporter sélection
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary" id="select-all">
|
||||||
|
<i class="bi bi-check-all"></i> Tout sélectionner
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary" id="deselect-all">
|
||||||
|
<i class="bi bi-x-circle"></i> Désélectionner
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="table_container" class="table-container" >
|
||||||
|
<table id="stats-table" class="table table-bordered table-striped table-hover table-responsive table-sort">
|
||||||
{% include 'admin/stats/table-head.html.twig' %}
|
{% include 'admin/stats/table-head.html.twig' %}
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for commerce in stats.places %}
|
{% for commerce in stats.places %}
|
||||||
|
@ -217,6 +244,9 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card mt-4">
|
<div class="card mt-4">
|
||||||
|
@ -224,54 +254,57 @@
|
||||||
<h2>Podium des contributeurs OSM de cette ville</h2>
|
<h2>Podium des contributeurs OSM de cette ville</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-striped table-bordered mt-4" style="max-width:800px">
|
<div class="table-container" >
|
||||||
<thead class="table-dark">
|
|
||||||
<tr>
|
<table class="table table-striped table-bordered mt-4" style="max-width:800px">
|
||||||
<th scope="col">#</th>
|
<thead class="table-dark">
|
||||||
<th scope="col">Utilisateur OSM</th>
|
|
||||||
<th scope="col">Nombre de lieux</th>
|
|
||||||
<th scope="col">Score de complétion moyen</th>
|
|
||||||
<th scope="col">Score de complétion pondéré</th>
|
|
||||||
<th scope="col">Score pondéré normalisé (0-100)</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for row in podium_local %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ loop.index }}</th>
|
<th scope="col">#</th>
|
||||||
<td>
|
<th scope="col">Utilisateur OSM</th>
|
||||||
<a href="https://www.openstreetmap.org/user/{{ row.osm_user|e('url') }}" target="_blank">
|
<th scope="col">Nombre de lieux</th>
|
||||||
{{ row.osm_user }}
|
<th scope="col">Score de complétion moyen</th>
|
||||||
</a>
|
<th scope="col">Score de complétion pondéré</th>
|
||||||
</td>
|
<th scope="col">Score pondéré normalisé (0-100)</th>
|
||||||
<td>{{ row.nb }}</td>
|
|
||||||
<td>
|
|
||||||
{% if row.completion_moyen is not null %}
|
|
||||||
{{ row.completion_moyen }} %
|
|
||||||
{% else %}
|
|
||||||
<span class="text-muted">N/A</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if row.completion_pondere is not null %}
|
|
||||||
{{ row.completion_pondere }}
|
|
||||||
{% else %}
|
|
||||||
<span class="text-muted">N/A</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{% if row.completion_pondere_normalisee is not null %}
|
|
||||||
{{ row.completion_pondere_normalisee }}
|
|
||||||
{% else %}
|
|
||||||
<span class="text-muted">N/A</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
</thead>
|
||||||
<tr><td colspan="6">Aucun contributeur trouvé pour cette ville.</td></tr>
|
<tbody>
|
||||||
{% endfor %}
|
{% for row in podium_local %}
|
||||||
</tbody>
|
<tr>
|
||||||
</table>
|
<th scope="row">{{ loop.index }}</th>
|
||||||
|
<td>
|
||||||
|
<a href="https://www.openstreetmap.org/user/{{ row.osm_user|e('url') }}" target="_blank">
|
||||||
|
{{ row.osm_user }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>{{ row.nb }}</td>
|
||||||
|
<td>
|
||||||
|
{% if row.completion_moyen is not null %}
|
||||||
|
{{ row.completion_moyen }} %
|
||||||
|
{% else %}
|
||||||
|
<span class="text-muted">N/A</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if row.completion_pondere is not null %}
|
||||||
|
{{ row.completion_pondere }}
|
||||||
|
{% else %}
|
||||||
|
<span class="text-muted">N/A</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% if row.completion_pondere_normalisee is not null %}
|
||||||
|
{{ row.completion_pondere_normalisee }}
|
||||||
|
{% else %}
|
||||||
|
<span class="text-muted">N/A</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr><td colspan="6">Aucun contributeur trouvé pour cette ville.</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -139,66 +139,68 @@
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h2>Statistiques par ville</h2>
|
<h2>Statistiques par ville</h2>
|
||||||
<input type="text" id="dashboard-table-search" class="form-control mb-2" placeholder="Filtrer les villes...">
|
<input type="text" id="dashboard-table-search" class="form-control mb-2" placeholder="Filtrer les villes...">
|
||||||
<div class="table-responsive">
|
<div class="table-container" >
|
||||||
<table id="dashboard-table" class="table table-striped table-sort">
|
<div class="table-responsive">
|
||||||
<thead>
|
<table id="dashboard-table" class="table table-striped table-sort">
|
||||||
<tr>
|
<thead>
|
||||||
<th>Ville</th>
|
|
||||||
<th>Code postal</th>
|
|
||||||
<th>Complétion</th>
|
|
||||||
<th>Nombre de commerces</th>
|
|
||||||
<th>Lieux par habitants</th>
|
|
||||||
<th>Budget</th>
|
|
||||||
<th>Budget/habitant</th>
|
|
||||||
<th>Budget/lieu</th>
|
|
||||||
<th>Date moyenne de mise à jour</th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for stat in stats_list %}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ path('app_admin_stats', {'insee_code': stat.zone}) }}" title="Voir les statistiques de cette ville">
|
<th>Ville</th>
|
||||||
{{ stat.name }}
|
<th>Code postal</th>
|
||||||
{% if not stat.name and stat.zone starts with '751' %}
|
<th>Complétion</th>
|
||||||
Paris {{ stat.zone|slice(-2) }}e.
|
<th>Nombre de commerces</th>
|
||||||
|
<th>Lieux par habitants</th>
|
||||||
{% endif %}
|
<th>Budget</th>
|
||||||
</a></td>
|
<th>Budget/habitant</th>
|
||||||
<td>{{ stat.zone }}</td>
|
<th>Budget/lieu</th>
|
||||||
<td>{{ stat.completionPercent }}%</td>
|
<th>Date moyenne de mise à jour</th>
|
||||||
<td>{{ stat.placesCount }}</td>
|
<th>Actions</th>
|
||||||
<td>{{ (stat.placesCount / (stat.population or 1 ))|round(2) }}</td>
|
|
||||||
<td>{% if stat.budgetAnnuel %}{{ (stat.budgetAnnuel / 1000000)|number_format(1, '.', ' ') }} M€{% else %}-{% endif %}</td>
|
|
||||||
<td>{% if stat.budgetAnnuel and stat.population %}{{ (stat.budgetAnnuel / stat.population)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
|
||||||
<td>{% if stat.budgetAnnuel and stat.placesCount %}{{ (stat.budgetAnnuel / stat.placesCount)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
|
||||||
<td>{{ stat.osmDataDateAvg|date('Y-m-d H:i') }}</td>
|
|
||||||
<td>
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
<a href="{{ path('app_admin_stats', {'insee_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', {'insee_code': stat.zone, 'deleteMissing': 1}) }}"
|
|
||||||
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', {'insee_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>
|
</tr>
|
||||||
{% endfor %}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
{% for stat in stats_list %}
|
||||||
|
<tr>
|
||||||
|
<td><a href="{{ path('app_admin_stats', {'insee_code': stat.zone}) }}" title="Voir les statistiques de cette ville">
|
||||||
|
{{ stat.name }}
|
||||||
|
{% if not stat.name and stat.zone starts with '751' %}
|
||||||
|
Paris {{ stat.zone|slice(-2) }}e.
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
</a></td>
|
||||||
|
<td>{{ stat.zone }}</td>
|
||||||
|
<td>{{ stat.completionPercent }}%</td>
|
||||||
|
<td>{{ stat.placesCount }}</td>
|
||||||
|
<td>{{ (stat.placesCount / (stat.population or 1 ))|round(2) }}</td>
|
||||||
|
<td>{% if stat.budgetAnnuel %}{{ (stat.budgetAnnuel / 1000000)|number_format(1, '.', ' ') }} M€{% else %}-{% endif %}</td>
|
||||||
|
<td>{% if stat.budgetAnnuel and stat.population %}{{ (stat.budgetAnnuel / stat.population)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
||||||
|
<td>{% if stat.budgetAnnuel and stat.placesCount %}{{ (stat.budgetAnnuel / stat.placesCount)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
||||||
|
<td>{{ stat.osmDataDateAvg|date('Y-m-d H:i') }}</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
<a href="{{ path('app_admin_stats', {'insee_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', {'insee_code': stat.zone, 'deleteMissing': 1}) }}"
|
||||||
|
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', {'insee_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 %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue