make W-L-T column sortable (by wins, then fewest losses)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 20:16:03 -05:00
co-authored by Claude Sonnet 4.6
parent 9c07036a85
commit 3a57967214
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
<th class="w-12">#</th>
<th class="cursor-pointer select-none" data-sort="name">Player</th>
<th class="text-right cursor-pointer select-none" data-sort="pts">ITC Points</th>
<th class="text-right hidden sm:table-cell">WLT</th>
<th class="text-right hidden sm:table-cell cursor-pointer select-none" data-sort="wlt">WLT</th>
<th class="text-right hidden sm:table-cell cursor-pointer select-none" data-sort="wpct">Win %</th>
<th class="text-right hidden sm:table-cell cursor-pointer select-none" data-sort="rank">ITC Rank</th>
</tr>
+1
View File
@@ -67,6 +67,7 @@ let lastState = null;
const sortCols = {
pts: { key: r => +(r.ITCPoints || 0), defaultDir: 'desc' },
name: { key: r => fullName(r.user || {}).toLowerCase() || '', defaultDir: 'asc' },
wlt: { key: r => (+r.wins||0) * 10000 - (+r.losses||0) * 100 - (+r.ties||0), defaultDir: 'desc' },
wpct: { key: r => { const g=(+r.wins||0)+(+r.losses||0)+(+r.ties||0); return g?(+r.wins||0)/g:-1; }, defaultDir: 'desc' },
rank: { key: r => +(r.placing || Infinity), defaultDir: 'asc' },
};