From b9c7d6c6639f1d609ba5429fdbfb039a3bd1aa5b Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Fri, 10 Jul 2026 12:29:08 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20sort=20repertoire=20Ann=C3=A9es=20column?= =?UTF-8?q?=20reverse=20chronological=20(newest=20first)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 2 +- app/templates/partials/repertoire-index.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index e72715b..9a2f599 100644 --- a/TODO.md +++ b/TODO.md @@ -46,4 +46,4 @@ - [x] Wider heading scale (h1/h2/h3) for apropos/licence/charte pages: step-5 / step-3 / step-1 - [x] Masquer le bloc "Durée" sur la page TFE quand aucune durée n'est encodée (ni pages ni minutes) - [x] Fix: locked_year cleared on edit — edit dialog didn't populate the field, so any edit cleared the locked academic year -- [x] Consistent scrollbar styling across browsers (WebKit/Blink/Firefox): custom properties in colors.css, unified rules in base.css, removed redundant declarations +- [x] Fix repertoire Années column: sort reverse chronological (newest first) instead of ascending alpha diff --git a/app/templates/partials/repertoire-index.php b/app/templates/partials/repertoire-index.php index c0dafa9..99e4a5c 100644 --- a/app/templates/partials/repertoire-index.php +++ b/app/templates/partials/repertoire-index.php @@ -115,7 +115,8 @@ foreach ($filterColumns as $col) { // viable entries at the top so users don't have to scroll past faded ones. $sortMatchedFirst = fn($a, $b) => ($b['matched'] <=> $a['matched']) ?: strcasecmp($a['value'], $b['value']); -usort($repData['years'], $sortMatchedFirst); +usort($repData['years'], fn($a, $b) => + ($b['matched'] <=> $a['matched']) ?: ($b['value'] <=> $a['value'])); usort($repData['ap_programs'], $sortMatchedFirst); usort($repData['orientations'], $sortMatchedFirst); usort($repData['finality_types'], $sortMatchedFirst);