This commit is contained in:
Tykayn 2025-09-05 15:58:26 +02:00 committed by tykayn
parent dffb21b56e
commit 1ed74c2e2f
9 changed files with 1610 additions and 305 deletions

View file

@ -79,8 +79,10 @@ python3 wiki_compare.py</code></pre>
<tbody>
{% for page in regular_pages|slice(0, 20) %}
<tr>
<td><strong>{{ page.key }}</strong></td>
<td>{{ page.reason }}</td>
<td><strong>{{ page.title }}</strong></td>
<td>
{# {{ page.reason }}#}
</td>
<td class="text-center">
{% if page.word_diff > 0 %}
<span class="badge bg-danger">{{ page.word_diff }}</span>
@ -126,22 +128,52 @@ python3 wiki_compare.py</code></pre>
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>
<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>
{% if page.fr_page is defined and page.fr_page %}
{% if page.fr_page.url is defined %}
<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>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-translate"></i> FR (URL manquante)
</button>
{% endif %}
{% if page.key is defined %}
<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>
{% elseif page.title is defined %}
<a href="{{ path('app_admin_wiki_compare', {'key': page.title}) }}"
class="btn btn-sm btn-outline-secondary"
title="Comparer les versions">
<i class="bi bi-arrows-angle-expand"></i> Comparer
</a>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-arrows-angle-expand"></i> Comparer
</button>
{% endif %}
{% else %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.key}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% if page.key is defined %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.key}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% elseif page.title is defined %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.title}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-plus-circle"></i> Clé manquante
</button>
{% endif %}
{% endif %}
</div>
</td>
@ -178,17 +210,17 @@ python3 wiki_compare.py</code></pre>
{% 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 }}"
alt="{% if page.key is defined %}{{ page.key }}{% elseif page.title is defined %}{{ page.title }}{% else %}Image{% endif %}"
style="max-width: 80px; max-height: 60px; object-fit: contain;">
</div>
{% endif %}
<div>
<strong>{{ page.key }}</strong>
<strong>{{ page.title }}</strong>
</div>
</div>
</td>
<td>
{{ page.reason }}
{# {{ page.reason }}#}
</td>
<td>
<div class="progress" style="height: 20px;">
@ -208,22 +240,52 @@ python3 wiki_compare.py</code></pre>
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>
<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>
{% if page.fr_page is defined and page.fr_page %}
{% if page.fr_page.url is defined %}
<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>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-translate"></i> FR (URL manquante)
</button>
{% endif %}
{% if page.key is defined %}
<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>
{% elseif page.title is defined %}
<a href="{{ path('app_admin_wiki_compare', {'key': page.title}) }}"
class="btn btn-sm btn-outline-secondary"
title="Comparer les versions">
<i class="bi bi-arrows-angle-expand"></i> Comparer
</a>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-arrows-angle-expand"></i> Comparer
</button>
{% endif %}
{% else %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.key}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% if page.key is defined %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.key}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% elseif page.title is defined %}
<a href="{{ path('app_admin_wiki_create_french', {'key': page.title}) }}"
class="btn btn-sm btn-success"
title="Créer une traduction française">
<i class="bi bi-plus-circle"></i> Traduire
</a>
{% else %}
<button class="btn btn-sm btn-outline-secondary" disabled>
<i class="bi bi-plus-circle"></i> Clé manquante
</button>
{% endif %}
{% endif %}
</div>
</td>
@ -251,7 +313,13 @@ python3 wiki_compare.py</code></pre>
const colors = [];
{% for page in regular_pages|slice(0, 20) %}
labels.push("{{ page.key }}");
{% if page.key is defined %}
labels.push("{{ page.key }}");
{% elseif page.title is defined %}
labels.push("{{ page.title }}");
{% else %}
labels.push("Page sans clé");
{% endif %}
scores.push({{ page.staleness_score }});
// Set color based on score