Refactor user stats page to display year in ranking tab badge

Co-authored-by: mathieumoran1 <[email protected]>
This commit is contained in:
Cursor Agent
2025-12-22 23:10:44 +00:00
co-authored by mathieumoran1
parent bc6ec169b0
commit 7f5773340f
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -623,8 +623,14 @@ window.addEventListener('DOMContentLoaded', async function () {
const activeYear = await fetchActiveYear();
if (activeYear) {
document.title = `Pool Oscars (${activeYear}) - Statistiques des utilisateurs`;
// Keep the main heading clean; show the year in the "Classement" tab instead.
const h2 = document.querySelector('h2');
if (h2) h2.textContent = `Statistiques des utilisateurs (${activeYear})`;
if (h2) h2.textContent = 'Statistiques des utilisateurs';
const badge = document.getElementById('stats-active-year-badge');
if (badge) {
badge.textContent = String(activeYear);
badge.classList.remove('d-none');
}
}
const statsUrl = activeYear ? `/api/users/stats?year=${encodeURIComponent(String(activeYear))}` : '/api/users/stats';
+1
View File
@@ -84,6 +84,7 @@
<li class="nav-item" role="presentation">
<button class="nav-link active" id="tab-ranking" data-bs-toggle="tab" data-bs-target="#pane-ranking" type="button" role="tab" aria-controls="pane-ranking" aria-selected="true">
Classement
<span id="stats-active-year-badge" class="badge bg-dark ms-2 d-none" aria-label="Année active"></span>
</button>
</li>
<li class="nav-item" role="presentation">