add specific follow of translation pages

This commit is contained in:
Tykayn 2025-09-01 00:29:17 +02:00 committed by tykayn
parent 7a7704bc01
commit bd3d14e9f8
11 changed files with 48190 additions and 268240 deletions

View file

@ -37,7 +37,8 @@
<tr>
<td>
<img src="{{ languages['en'].description_img_url }}" alt="image" style="height: 2rem;">
<img src="{{ languages['en'].description_img_url }}" alt="image"
style="height: 2rem;">
</td>
<td>
@ -152,11 +153,11 @@
class="btn btn-sm btn-outline-info" title="Version anglaise">
<i class="bi bi-flag-fill"></i> EN
</a>
<a href="{{ path('app_admin_wiki_create_french', {'key': key}) }}"
class="btn btn-sm btn-outline-primary"
title="Créer une traduction française">
<i class="bi bi-translate"></i> créer FR
</a>
{# <a href="{{ path('app_admin_wiki_create_french', {'key': key}) }}" #}
{# class="btn btn-sm btn-outline-primary" #}
{# title="Créer une traduction française"> #}
{# <i class="bi bi-translate"></i> créer FR #}
{# </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"> #}
@ -172,7 +173,87 @@
</div>
</div>
{% endif %}
{% if specific_pages is defined and specific_pages|length > 0 %}
<div class="card mb-4">
<div class="card-header bg-primary text-white">
<h2>Pages spécifiques ({{ specific_pages|length }})</h2>
</div>
<div class="card-body">
<p>Ces pages wiki sont des pages spécifiques qui ont été sélectionnées pour une comparaison particulière.</p>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Titre</th>
<th>Raison</th>
<th>Score de décrépitude</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for page in specific_pages %}
<tr>
<td>
<div class="d-flex align-items-center">
{% if page.en_page.description_img_url is defined and page.en_page.description_img_url %}
<div class="me-3">
<img src="{{ page.en_page.description_img_url }}" alt="{{ page.key }}"
style="max-width: 80px; max-height: 60px; object-fit: contain;">
</div>
{% endif %}
<div>
<strong>{{ page.key }}</strong>
<span class="badge bg-primary">Spécifique</span>
</div>
</div>
</td>
<td>
{{ page.reason }}
</td>
<td>
{% if page.staleness_score is defined %}
<div class="progress" style="height: 20px;">
{% set score_class = page.staleness_score > 70 ? 'bg-danger' : (page.staleness_score > 40 ? 'bg-warning' : 'bg-success') %}
<div class="progress-bar {{ score_class }}" role="progressbar"
style="width: {{ page.staleness_score }}%;"
aria-valuenow="{{ page.staleness_score }}"
aria-valuemin="0"
aria-valuemax="100">
{{ page.staleness_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.en_page.url }}" target="_blank"
class="btn btn-sm btn-outline-primary" title="Version anglaise">
<i class="bi bi-translate"></i> EN
</a>
{% if page.fr_page %}
<a href="{{ page.fr_page.url }}" target="_blank"
class="btn btn-sm btn-outline-info" title="Version française">
<i class="bi bi-translate"></i> FR
</a>
{% endif %}
<a href="{{ path('app_admin_wiki_compare', {'key': page.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>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if pages_unavailable_in_english|length > 0 %}
<div class="card mb-4">
<div class="card-header bg-info text-dark">

View file

@ -59,10 +59,21 @@
<h1>Comparaison Wiki OpenStreetMap - {{ key }}
<a href="https://wiki.openstreetmap.org/FR:Key:{{ key }}">fr</a>
<a href="https://wiki.openstreetmap.org/Key:{{ key }}">en</a>
{% if en_page.is_specific_page is defined and en_page.is_specific_page %}
<a href="{{ fr_page.url|default('https://wiki.openstreetmap.org/wiki/FR:' ~ key) }}">fr</a>
<a href="{{ en_page.url }}">en</a>
{% else %}
<a href="https://wiki.openstreetmap.org/wiki/FR:Key:{{ key }}">fr</a>
<a href="https://wiki.openstreetmap.org/wiki/Key:{{ key }}">en</a>
{% endif %}
</h1>
<p class="lead">Comparaison détaillée des pages wiki en français et en anglais pour la clé OSM "{{ key }}".</p>
<p class="lead">
{% if en_page.is_specific_page is defined and en_page.is_specific_page %}
Comparaison détaillée des pages wiki en français et en anglais pour "{{ key }}".
{% else %}
Comparaison détaillée des pages wiki en français et en anglais pour la clé OSM "{{ key }}".
{% endif %}
</p>
<div class="row mb-4">
<div class="col-md-6">