From 7f5773340f030c0e744e492f7f703d88c6cbc1b9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 22 Dec 2025 23:10:44 +0000 Subject: [PATCH] Refactor user stats page to display year in ranking tab badge Co-authored-by: mathieumoran1 --- public/js/app_user-stat.js | 8 +++++++- public/user-stat.html | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/js/app_user-stat.js b/public/js/app_user-stat.js index 209a760..8f202df 100644 --- a/public/js/app_user-stat.js +++ b/public/js/app_user-stat.js @@ -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'; diff --git a/public/user-stat.html b/public/user-stat.html index c434973..d7bd1ba 100644 --- a/public/user-stat.html +++ b/public/user-stat.html @@ -84,6 +84,7 @@