Skip to content

Commit db65b8a

Browse files
committed
Admin page: leave archived games out of the game menu and Hours by game
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cw2rM83QU3zxfQu1UxFEBM
1 parent a665ef7 commit db65b8a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎e63334287a3deaa3/d06440218d1813a3/index.html‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,9 @@ <h2>Can't read feedback</h2>
560560
function fillGames(){
561561
var sel=$('sGame'),cur=sel.value||'all';
562562
sel.textContent='';opt(sel,'all','All games');
563-
if(LB)LB.GAMES.forEach(function(g){opt(sel,g.d,g.n)});
564-
sel.value=cur==='all'||(LB&&LB.BY[cur])?cur:'all';
563+
// Archived games (gone: 1 in leaderboard.js) are left out of the menu and the Hours by game list; their time still counts in the totals.
564+
if(LB)LB.GAMES.forEach(function(g){if(!g.gone)opt(sel,g.d,g.n)});
565+
sel.value=cur==='all'||(LB&&LB.BY[cur]&&!LB.BY[cur].gone)?cur:'all';
565566
}
566567
// The day keys in a range ('1', '7', '30'), or null for all time.
567568
function daysIn(range){if(range==='all')return null;var n=Math.max(1,Math.min(DAYS,+range||1)),set={};for(var i=0;i<n;i++)set[dayAgo(i)]=1;return set}
@@ -594,7 +595,7 @@ <h2>Can't read feedback</h2>
594595
Object.keys(per).forEach(function(d){gs[d]=(gs[d]||0)+per[d];gp[d]=(gp[d]||0)+1});
595596
total+=v;if(p.ga)google++;
596597
});
597-
var games=LB.GAMES.filter(function(g){return gs[g.d]>0}).map(function(g){return {d:g.d,n:g.n,s:gs[g.d],people:gp[g.d]}}).sort(function(a,b){return b.s-a.s||b.people-a.people});
598+
var games=LB.GAMES.filter(function(g){return !g.gone&&gs[g.d]>0}).map(function(g){return {d:g.d,n:g.n,s:gs[g.d],people:gp[g.d]}}).sort(function(a,b){return b.s-a.s||b.people-a.people});
598599
return {range:range,gv:gv,gOnly:gOnly,days:days,list:list,idle:idle,games:games,total:total,google:google};
599600
}
600601
var last=null;

0 commit comments

Comments
 (0)