conteneur de tableau long

This commit is contained in:
Tykayn 2025-06-29 10:22:24 +02:00 committed by tykayn
parent f50f2f87f5
commit 2ea7f7711f
3 changed files with 148 additions and 106 deletions

View file

@ -208,8 +208,35 @@
</a>
</div>
</div>
{# <input type="text" id="stats-table-search" class="form-control mb-2" placeholder="Filtrer les lieux..."> #}
<table id="stats-table" class="table table-bordered table-striped table-hover table-responsive table-sort">
<div id="table-container">
<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' %}
<tbody>
{% for commerce in stats.places %}
@ -217,6 +244,9 @@
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="card mt-4">
@ -224,54 +254,57 @@
<h2>Podium des contributeurs OSM de cette ville</h2>
</div>
<div class="card-body">
<table class="table table-striped table-bordered mt-4" style="max-width:800px">
<thead class="table-dark">
<tr>
<th scope="col">#</th>
<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 %}
<div class="table-container" >
<table class="table table-striped table-bordered mt-4" style="max-width:800px">
<thead class="table-dark">
<tr>
<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 }}&nbsp;%
{% 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>
<th scope="col">#</th>
<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>
{% else %}
<tr><td colspan="6">Aucun contributeur trouvé pour cette ville.</td></tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for row in podium_local %}
<tr>
<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 }}&nbsp;%
{% 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>