mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Sort all filter columns: matched entries first, then unmatched, both alphabetical
This commit is contained in:
@@ -111,11 +111,15 @@ foreach ($filterColumns as $col) {
|
||||
<div id="repertoire-index" class="repertoire-index">
|
||||
|
||||
<?php
|
||||
// Sort keywords: matched first (alpha), then unmatched (alpha) — keeps viable
|
||||
// tags at the top so users don't have to scroll past faded entries.
|
||||
usort($repData['keywords'], fn($a, $b) =>
|
||||
($b['matched'] <=> $a['matched']) ?: strcasecmp($a['value'], $b['value'])
|
||||
);
|
||||
// Sort filter columns: matched first (alpha), then unmatched (alpha) — keeps
|
||||
// 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['ap_programs'], $sortMatchedFirst);
|
||||
usort($repData['orientations'], $sortMatchedFirst);
|
||||
usort($repData['finality_types'], $sortMatchedFirst);
|
||||
usort($repData['keywords'], $sortMatchedFirst);
|
||||
|
||||
// Render filter columns in the correct left-to-right order.
|
||||
// Students column (non-filter) is inserted between keywords and AP/or/fi/years.
|
||||
|
||||
Reference in New Issue
Block a user