Add visibility toggle for picks features and rename Mes choix to Mes picks

- Renamed 'Mes choix' to 'Mes picks' across all pages and JavaScript files
- Added visibility toggle in control panel (Réglages > Visibilité) to control:
  - Display of 'Mes picks' button in navigation
  - Display of 'Bon picks' column in user statistics
- Combined both visibility options into single toggle for simplicity
- Added backend API endpoints for visibility configuration
- Implemented localStorage caching for instant visibility updates
- Fixed flash of content issues when navigating between pages
- Updated stats endpoint to calculate correct picks on-the-fly from current winners
- Renamed 'Bonnes réponses' to 'Bon picks' in user statistics table
This commit is contained in:
Mathieu Moran
2025-12-27 22:03:01 -05:00
parent 1281d77c4e
commit 70b309d1ae
14 changed files with 488 additions and 314 deletions
+1 -5
View File
@@ -248,13 +248,9 @@ router.post("/calculate-scores", verifyToken, async (req, res) => {
}
});
// Get scores for all users (admin only)
// Get scores for all users (available to all authenticated users)
router.get("/scores", verifyToken, async (req, res) => {
try {
if (!isAdmin(req.user)) {
return res.status(403).json({ message: "You do not have admin privileges" });
}
const year = parseOscarYear(req.query.year) || await getOrInitActiveYear();
const picks = await OscarPick.find({ year })