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/info.pug | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'views/info.pug') diff --git a/views/info.pug b/views/info.pug index 60eac7b..51fc81d 100644 --- a/views/info.pug +++ b/views/info.pug @@ -1,9 +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) -- let finished_games = games2 doctype html html head @@ -24,25 +19,23 @@ html p Read more about the game on #[a(href="https://boardgamegeek.com/boardgame/"+title.bgg) boardgamegeek.com]. - h2 Open if open_games.length > 0 + h2 Open +gamelist(open_games, true) - else - p No open games. if replacement_games.length > 0 - h2 Need replacement + h2 Open (missing players) +gamelist(replacement_games, true) p a(href="/create/"+title.title_id) Create a new game if ready_games.length > 0 - h2 Ready + h2 Open (waiting to start) +gamelist(ready_games, true) if active_games.length > 0 - h2 Active + h2 Recently active +gamelist(active_games, true) if finished_games.length > 0 -- cgit v1.2.3