summaryrefslogtreecommitdiff
path: root/views/user.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-06-14 20:40:25 +0200
committerTor Andersson <tor@ccxvii.net>2022-06-14 21:09:48 +0200
commit06f757c23d0d9f7a2b86f6c828f886ee8e642e03 (patch)
tree56771af9be14e393e2753a70c7080f5558e28014 /views/user.pug
parentae02f4cde98879b6fddc12c87c4fd3c5663d493e (diff)
downloadserver-06f757c23d0d9f7a2b86f6c828f886ee8e642e03.tar.gz
Clean up game list logic.
Diffstat (limited to 'views/user.pug')
-rw-r--r--views/user.pug9
1 files changed, 8 insertions, 1 deletions
diff --git a/views/user.pug b/views/user.pug
index 73c2e2d..fb98da7 100644
--- a/views/user.pug
+++ b/views/user.pug
@@ -1,4 +1,7 @@
//- vim:ts=4:sw=4:
+- let open_games = games.filter(game => game.status === 0)
+- let active_games = games.filter(game => game.status === 1)
+- let finished_games = games.filter(game => game.status === 2)
doctype html
html
head
@@ -22,8 +25,12 @@ html
p
a(href="/message/send/"+who.name) Send message
+ if open_games.length > 0
+ h2 Open
+ +gamelist(open_games)
+
if active_games.length > 0
- h2 Playing
+ h2 Active
+gamelist(active_games)
if finished_games.length > 0