This commit is contained in:
Tykayn 2025-09-03 17:18:21 +02:00 committed by tykayn
parent 0df830f93d
commit 2ad98b5864
11 changed files with 808 additions and 224 deletions

View file

@ -20,6 +20,31 @@
</div>
<div class="card-body">
{% if wiki_pages_stats is defined %}
<div class="alert alert-info mb-3">
<h4>Statistiques des pages wiki</h4>
<div class="row">
<div class="col-md-6">
<h5>Pages en anglais</h5>
<ul>
<li><strong>Sections :</strong> Moyenne: {{ wiki_pages_stats.en_sections.mean }}, Écart type: {{ wiki_pages_stats.en_sections.std_dev }}</li>
<li><strong>Mots :</strong> Moyenne: {{ wiki_pages_stats.en_words.mean }}, Écart type: {{ wiki_pages_stats.en_words.std_dev }}</li>
<li><strong>Liens :</strong> Moyenne: {{ wiki_pages_stats.en_links.mean }}, Écart type: {{ wiki_pages_stats.en_links.std_dev }}</li>
<li><strong>Images :</strong> Moyenne: {{ wiki_pages_stats.en_media.mean }}, Écart type: {{ wiki_pages_stats.en_media.std_dev }}</li>
</ul>
</div>
<div class="col-md-6">
<h5>Pages en français</h5>
<ul>
<li><strong>Sections :</strong> Moyenne: {{ wiki_pages_stats.fr_sections.mean }}, Écart type: {{ wiki_pages_stats.fr_sections.std_dev }}</li>
<li><strong>Mots :</strong> Moyenne: {{ wiki_pages_stats.fr_words.mean }}, Écart type: {{ wiki_pages_stats.fr_words.std_dev }}</li>
<li><strong>Liens :</strong> Moyenne: {{ wiki_pages_stats.fr_links.mean }}, Écart type: {{ wiki_pages_stats.fr_links.std_dev }}</li>
<li><strong>Images :</strong> Moyenne: {{ wiki_pages_stats.fr_media.mean }}, Écart type: {{ wiki_pages_stats.fr_media.std_dev }}</li>
</ul>
</div>
</div>
</div>
{% endif %}
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="thead-dark">
@ -283,12 +308,13 @@
<thead class="thead-dark">
<tr>
<th>Titre</th>
<th>Score de décrépitude</th>
{# <th>Score de décrépitude</th>#}
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for page in pages_unavailable_in_english %}
{% if "FR:Réunions" not in page.title %}
<tr>
<td>
<div class="d-flex align-items-center">
@ -303,22 +329,22 @@
</div>
</div>
</td>
<td>
{% if page.outdatedness_score is defined %}
<div class="progress" style="height: 20px;">
{% set score_class = page.outdatedness_score > 70 ? 'bg-danger' : (page.outdatedness_score > 40 ? 'bg-warning' : 'bg-success') %}
<div class="progress-bar {{ score_class }}" role="progressbar"
style="width: {{ page.outdatedness_score }}%;"
aria-valuenow="{{ page.outdatedness_score }}"
aria-valuemin="0"
aria-valuemax="100">
{{ page.outdatedness_score }}
</div>
</div>
{% else %}
<span class="text-muted">Non disponible</span>
{% endif %}
</td>
{# <td>#}
{# {% if page.outdatedness_score is defined %}#}
{# <div class="progress" style="height: 20px;">#}
{# {% set score_class = page.outdatedness_score > 70 ? 'bg-danger' : (page.outdatedness_score > 40 ? 'bg-warning' : 'bg-success') %}#}
{# <div class="progress-bar {{ score_class }}" role="progressbar"#}
{# style="width: {{ page.outdatedness_score }}%;"#}
{# aria-valuenow="{{ page.outdatedness_score }}"#}
{# aria-valuemin="0"#}
{# aria-valuemax="100">#}
{# {{ page.outdatedness_score }}#}
{# </div>#}
{# </div>#}
{# {% else %}#}
{# <span class="text-muted">Non disponible</span>#}
{# {% endif %}#}
{# </td>#}
<td class="text-center">
<div class="btn-group" role="group">
<a href="{{ page.url }}" target="_blank"
@ -334,6 +360,7 @@
</div>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
@ -413,6 +440,16 @@
<h2>Graphe de décrépitude</h2>
</div>
<div class="card-body">
{% if staleness_stats is defined %}
<div class="alert alert-info mb-3">
<strong>Statistiques :</strong>
Moyenne : {{ staleness_stats.mean }} |
Écart type : {{ staleness_stats.std_dev }} |
Min : {{ staleness_stats.min }} |
Max : {{ staleness_stats.max }} |
Nombre de pages : {{ staleness_stats.count }}
</div>
{% endif %}
<canvas id="decrepitudeChart" height="300"></canvas>
</div>
</div>
@ -436,13 +473,19 @@
{% set score = languages['en'].staleness_score|default(0) %}
scores.push({{ score }});
// Set color based on score
{% if score > 50 %}
colors.push('rgba(220, 53, 69, 0.7)'); // danger
// Set color based on score with more nuanced intermediate colors
{% if score > 80 %}
colors.push('rgba(220, 53, 69, 0.7)'); // danger (red)
{% elseif score > 60 %}
colors.push('rgba(232, 113, 55, 0.7)'); // dark orange
{% elseif score > 40 %}
colors.push('rgba(255, 153, 0, 0.7)'); // orange
{% elseif score > 20 %}
colors.push('rgba(255, 193, 7, 0.7)'); // warning
colors.push('rgba(255, 193, 7, 0.7)'); // warning (yellow)
{% elseif score > 10 %}
colors.push('rgba(140, 195, 38, 0.7)'); // light green
{% else %}
colors.push('rgba(25, 135, 84, 0.7)'); // success
colors.push('rgba(25, 135, 84, 0.7)'); // success (green)
{% endif %}
{% endif %}
{% endfor %}