From 6407378d92eb8880e35e8ee33e1801136a1a44a7 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 10 Sep 2023 21:05:59 +0200 Subject: Set player_count in database for faster and easier logic. Track ready to start and unjoined games in "active" header. --- views/games_public.pug | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'views/games_public.pug') diff --git a/views/games_public.pug b/views/games_public.pug index d49fc9e..9afc45c 100644 --- a/views/games_public.pug +++ b/views/games_public.pug @@ -1,8 +1,4 @@ //- vim:ts=4:sw=4: -- let open_games = games0.filter(game => game.status === 0 && !game.is_full) -- let ready_games = games0.filter(game => game.status === 0 && game.is_full) -- let replacement_games = games1.filter(game => game.status === 1 && !game.is_full) -- let active_games = games1.filter(game => game.status === 1 && game.is_full) doctype html html head @@ -13,7 +9,7 @@ html body include header article - h1 All Public Games + h1 Public Games h2 Open if open_games.length > 0 @@ -21,17 +17,21 @@ html else p No open games. - p - a(href="/create") Create a new game - if replacement_games.length > 0 - h2 Need replacement + h2 Open (missing players) +gamelist(replacement_games) + p + a(href="/create") Create a new game + if ready_games.length > 0 - h2 Ready + h2 Open (waiting to start) +gamelist(ready_games) if active_games.length > 0 - h2 Active + h2 Recently active +gamelist(active_games) + + if finished_games.length > 0 + h2 Recently finished + +gamelist(finished_games) -- cgit v1.2.3