up autotraduction de toutes les pages manquantes en français listées
This commit is contained in:
parent
eb662fab5a
commit
920cf3af33
34 changed files with 26563 additions and 13 deletions
|
@ -796,6 +796,59 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if history_data is defined and history_data|length > 0 %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h2>Historique des mesures</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Ce graphique montre l'évolution du score de décrépitude et des métriques associées au fil du temps :</p>
|
||||
|
||||
<div class="mb-4">
|
||||
<canvas id="historyChart" width="400" height="200"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Score de décrépitude</th>
|
||||
<th>Diff. de date (jours)</th>
|
||||
<th>Diff. de mots</th>
|
||||
<th>Diff. de sections</th>
|
||||
<th>Diff. de liens</th>
|
||||
<th>Diff. d'images</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in history_data %}
|
||||
<tr>
|
||||
<td>{{ entry.date }}</td>
|
||||
<td>{{ entry.metrics.staleness_score|round(2) }}</td>
|
||||
<td>{{ entry.metrics.date_diff }}</td>
|
||||
<td>{{ entry.metrics.word_diff }}</td>
|
||||
<td>{{ entry.metrics.section_diff }}</td>
|
||||
<td>{{ entry.metrics.link_diff }}</td>
|
||||
<td>{{ entry.metrics.media_diff }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info mt-3">
|
||||
<p><strong>À propos de l'historique :</strong></p>
|
||||
<ul>
|
||||
<li>L'historique montre l'évolution des métriques au fil du temps, permettant de suivre les progrès ou la dégradation de la traduction.</li>
|
||||
<li>Une tendance à la baisse du score de décrépitude indique une amélioration de la qualité de la traduction.</li>
|
||||
<li>Les données sont collectées à chaque exécution du script d'analyse.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="{{ path('app_admin_wiki') }}" class="btn btn-secondary">
|
||||
<i class="bi bi-arrow-left"></i> Retour à la liste des pages wiki
|
||||
|
@ -932,6 +985,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Add click event listeners to all copy buttons
|
||||
|
@ -1023,6 +1077,123 @@
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Create history chart if the element exists
|
||||
const historyChartElement = document.getElementById('historyChart');
|
||||
if (historyChartElement) {
|
||||
// Get history data from the template
|
||||
const historyData = {{ history_data|json_encode|raw }};
|
||||
|
||||
if (historyData && historyData.length > 0) {
|
||||
// Prepare data for the chart
|
||||
const labels = historyData.map(entry => entry.date);
|
||||
const stalenessScores = historyData.map(entry => entry.metrics.staleness_score);
|
||||
const wordDiffs = historyData.map(entry => entry.metrics.word_diff);
|
||||
const sectionDiffs = historyData.map(entry => entry.metrics.section_diff);
|
||||
const linkDiffs = historyData.map(entry => entry.metrics.link_diff);
|
||||
|
||||
// Create the chart
|
||||
const ctx = historyChartElement.getContext('2d');
|
||||
const historyChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Score de décrépitude',
|
||||
data: stalenessScores,
|
||||
borderColor: 'rgba(255, 99, 132, 1)',
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
||||
borderWidth: 2,
|
||||
tension: 0.1,
|
||||
yAxisID: 'y'
|
||||
},
|
||||
{
|
||||
label: 'Différence de mots',
|
||||
data: wordDiffs,
|
||||
borderColor: 'rgba(54, 162, 235, 1)',
|
||||
backgroundColor: 'rgba(54, 162, 235, 0.2)',
|
||||
borderWidth: 2,
|
||||
tension: 0.1,
|
||||
yAxisID: 'y1',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
label: 'Différence de sections',
|
||||
data: sectionDiffs,
|
||||
borderColor: 'rgba(75, 192, 192, 1)',
|
||||
backgroundColor: 'rgba(75, 192, 192, 0.2)',
|
||||
borderWidth: 2,
|
||||
tension: 0.1,
|
||||
yAxisID: 'y1',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
label: 'Différence de liens',
|
||||
data: linkDiffs,
|
||||
borderColor: 'rgba(153, 102, 255, 1)',
|
||||
backgroundColor: 'rgba(153, 102, 255, 0.2)',
|
||||
borderWidth: 2,
|
||||
tension: 0.1,
|
||||
yAxisID: 'y1',
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
interaction: {
|
||||
mode: 'index',
|
||||
intersect: false,
|
||||
},
|
||||
stacked: false,
|
||||
scales: {
|
||||
y: {
|
||||
type: 'linear',
|
||||
display: true,
|
||||
position: 'left',
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Score de décrépitude'
|
||||
}
|
||||
},
|
||||
y1: {
|
||||
type: 'linear',
|
||||
display: true,
|
||||
position: 'right',
|
||||
grid: {
|
||||
drawOnChartArea: false,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Différences'
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Évolution des métriques au fil du temps'
|
||||
},
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
let label = context.dataset.label || '';
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
if (context.parsed.y !== null) {
|
||||
label += context.parsed.y.toFixed(2);
|
||||
}
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue