add wiki compare
This commit is contained in:
parent
692e609a46
commit
38fbc451f5
9 changed files with 81151 additions and 126 deletions
|
@ -19,6 +19,8 @@
|
|||
<th rowspan="2">Clé</th>
|
||||
<th colspan="3" class="text-center">Version anglaise</th>
|
||||
<th colspan="3" class="text-center">Version française</th>
|
||||
<th rowspan="2" class="text-center">Score de<br>décrépitude</th>
|
||||
<th rowspan="2" class="text-center">Liens</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sections</th>
|
||||
|
@ -31,27 +33,45 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for key, languages in wiki_pages %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{ key }}</strong>
|
||||
</td>
|
||||
|
||||
{% if languages['en'] is defined %}
|
||||
{% if languages['en'] is defined and languages['fr'] is defined %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{{ key }}</strong>
|
||||
</td>
|
||||
|
||||
<td>{{ languages['en'].sections }}</td>
|
||||
<td>{{ languages['en'].word_count }}</td>
|
||||
<td>{{ languages['en'].link_count }}</td>
|
||||
{% else %}
|
||||
<td colspan="3" class="text-center text-muted">Page non disponible</td>
|
||||
{% endif %}
|
||||
|
||||
{% if languages['fr'] is defined %}
|
||||
|
||||
<td>{{ languages['fr'].sections }}</td>
|
||||
<td>{{ languages['fr'].word_count }}</td>
|
||||
<td>{{ languages['fr'].link_count }}</td>
|
||||
{% else %}
|
||||
<td colspan="3" class="text-center text-muted">Page non disponible</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
<td class="text-center">
|
||||
{% set score = languages['en'].staleness_score|default(0) %}
|
||||
{% if score > 50 %}
|
||||
<span class="badge bg-danger">{{ score }}</span>
|
||||
{% elseif score > 20 %}
|
||||
<span class="badge bg-warning text-dark">{{ score }}</span>
|
||||
{% else %}
|
||||
<span class="badge bg-success">{{ score }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ languages['en'].url }}" target="_blank" class="btn btn-sm btn-outline-primary" title="Version anglaise">
|
||||
<i class="bi bi-translate"></i> EN
|
||||
</a>
|
||||
<a href="{{ languages['fr'].url }}" target="_blank" class="btn btn-sm btn-outline-info" title="Version française">
|
||||
<i class="bi bi-translate"></i> FR
|
||||
</a>
|
||||
<a href="{{ path('app_admin_wiki_compare', {'key': key}) }}" class="btn btn-sm btn-outline-secondary" title="Comparer les versions">
|
||||
<i class="bi bi-arrows-angle-expand"></i> Comparer
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -59,6 +79,57 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if missing_translations|length > 0 %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-warning text-dark">
|
||||
<h2>Pages manquantes en français</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Ces pages wiki ont une version anglaise mais pas de traduction française.</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Clé</th>
|
||||
<th>Sections</th>
|
||||
<th>Mots</th>
|
||||
<th>Liens</th>
|
||||
<th>Score de décrépitude</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for key, page in missing_translations %}
|
||||
<tr>
|
||||
<td><strong>{{ key }}</strong></td>
|
||||
<td>{{ page.sections }}</td>
|
||||
<td>{{ page.word_count }}</td>
|
||||
<td>{{ page.link_count }}</td>
|
||||
<td>
|
||||
<span class="badge bg-danger">{{ page.staleness_score|default(100) }}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ page.url }}" target="_blank" class="btn btn-sm btn-outline-primary" title="Version anglaise">
|
||||
<i class="bi bi-translate"></i> EN
|
||||
</a>
|
||||
<a href="{{ path('app_admin_wiki_compare', {'key': key}) }}" class="btn btn-sm btn-outline-secondary" title="Voir les détails et créer la page française">
|
||||
<i class="bi bi-arrows-angle-expand"></i> Comparer
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<p>
|
||||
le score de fraîcheur prend en compte d'avantage la différence entre le nombre de mots que l'ancienneté de modification.
|
||||
On compte aussi le nombre de sections et de liens.
|
||||
</p>
|
||||
<div class="mt-3">
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue