fix pages zones

This commit is contained in:
Tykayn 2025-07-03 10:28:49 +02:00 committed by tykayn
parent 1c24ae1fea
commit 00977d4fba
9 changed files with 6085 additions and 433 deletions

View file

@ -115,14 +115,14 @@ function getDelta(data, days) {
return ref !== null ? last - ref : null;
}
function formatDelta(val) {
if (val === null) return '-';
if (val === null) return 'Pas de données';
if (val === 0) return '0';
return (val > 0 ? '+' : '') + val;
}
const delta7dCount = formatDelta(getDelta(countData, 7));
const delta7dCount = getDelta(countData, 7);
const infoDiv = document.createElement('div');
infoDiv.className = 'mt-3 alert alert-info';
infoDiv.innerHTML = `<strong>Progression sur 7 jours :</strong> ${delta7dCount}`;
infoDiv.className = 'mt-3 alert ' + (delta7dCount === null ? 'alert-secondary' : 'alert-info');
infoDiv.innerHTML = `<strong>Progression sur 7 jours :</strong> ${delta7dCount === null ? '<span title="Données insuffisantes pour calculer la progression">Aucune donnée</span>' : (delta7dCount > 0 ? '+' + delta7dCount : delta7dCount === 0 ? '0' : delta7dCount)}`;
canvas.parentNode.appendChild(infoDiv);
</script>
{% endblock %}