up compare

This commit is contained in:
Tykayn 2025-08-22 23:30:36 +02:00 committed by tykayn
parent e533c273b2
commit 2665adc897
7 changed files with 753 additions and 558 deletions

File diff suppressed because it is too large Load diff

View file

@ -66,11 +66,22 @@
</h2>
<div id="collapse{{ lang_prefix }}" class="accordion-collapse collapse {% if lang_prefix == 'En' %}show{% endif %}" aria-labelledby="heading{{ lang_prefix }}" data-bs-parent="#languageAccordion">
<div class="accordion-body">
{% if lang_prefix == 'En' %}
<div class="mb-3">
<button id="copyEnglishTitlesBtn" class="btn btn-outline-primary">
<i class="bi bi-clipboard"></i> Copier les titres au format MediaWiki
</button>
<span id="copyStatus" class="ms-2 text-success" style="display: none;">
<i class="bi bi-check-circle"></i> Copié !
</span>
</div>
{% endif %}
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Titre</th>
<th>Score de décrépitude</th>
<th>Actions</th>
</tr>
</thead>
@ -83,6 +94,22 @@
<span class="badge bg-success">Priorité</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>
<div class="btn-group" role="group">
<a href="{{ page.url }}" target="_blank" class="btn btn-sm btn-outline-primary" title="Voir la page originale">
@ -127,4 +154,43 @@
</a>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
document.addEventListener('DOMContentLoaded', function() {
const copyButton = document.getElementById('copyEnglishTitlesBtn');
const copyStatus = document.getElementById('copyStatus');
if (copyButton) {
copyButton.addEventListener('click', function() {
// Get all English page titles from the table
const englishSection = document.getElementById('collapseEn');
const titleElements = englishSection.querySelectorAll('tbody tr td:first-child strong');
// Format titles in MediaWiki format
let mediawikiText = '';
titleElements.forEach(function(element) {
const title = element.textContent.trim();
mediawikiText += '* [[' + title + ']]\n';
});
// Copy to clipboard
navigator.clipboard.writeText(mediawikiText).then(function() {
// Show success message
copyStatus.style.display = 'inline';
// Hide success message after 3 seconds
setTimeout(function() {
copyStatus.style.display = 'none';
}, 3000);
}).catch(function(err) {
console.error('Erreur lors de la copie: ', err);
alert('Erreur lors de la copie dans le presse-papier. Veuillez réessayer.');
});
});
}
});
</script>
{% endblock %}