From 88d909a874499f9d3d18e76ff30c1155caa2e48e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 13 Oct 2024 12:41:22 +0200 Subject: Improve sorting of games on active/user game pages. Separate sections for "your move" and "solo" games. Stable sorting order for other games. # Conflicts: # server.js # views/games_active.pug # views/user.pug --- views/user.pug | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'views/user.pug') diff --git a/views/user.pug b/views/user.pug index dbadd36..ce5b5f0 100644 --- a/views/user.pug +++ b/views/user.pug @@ -1,6 +1,8 @@ //- vim:ts=4:sw=4: -- let open_games = games.filter(game => game.status === 0) -- let active_games = games.filter(game => game.status === 1) +- let open_games = games.filter(game => game.status === 0 && !game.is_match) +- let future_games = games.filter(game => game.status === 0 && game.is_match) +- let active_games = games.filter(game => game.status === 1 && game.is_opposed) +- let solo_games = games.filter(game => game.status === 1 && !game.is_opposed) - let finished_games = games.filter(game => game.status === 2) doctype html html @@ -48,6 +50,14 @@ html h2 Active +gamelist(active_games) + if solo_games.length > 0 + h2 Solo + +gamelist(solo_games) + + if future_games.length > 0 + h2 Future + +gamelist(future_games) + if finished_games.length > 0 h2 Recently finished +gamelist(finished_games) -- cgit v1.2.3