summaryrefslogtreecommitdiff
path: root/views/head.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-06-12 16:42:33 +0200
committerTor Andersson <tor@ccxvii.net>2022-06-13 20:20:01 +0200
commit072766b71f9441fdd2796b8dd1137b90acd5a561 (patch)
tree27dce1ed3f835a964b8dcf1d5f976d2ac1b507e2 /views/head.pug
parent8175df9f9af2393964f053af5a98851c376e1675 (diff)
downloadserver-072766b71f9441fdd2796b8dd1137b90acd5a561.tar.gz
List playing and recently finished games on user pages.
Diffstat (limited to 'views/head.pug')
-rw-r--r--views/head.pug15
1 files changed, 12 insertions, 3 deletions
diff --git a/views/head.pug b/views/head.pug
index 911def4..748d417 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -34,11 +34,20 @@ mixin forumpost(row,show_buttons)
|
| #[a(href="/forum/reply/"+row.post_id) Reply]
-mixin gamelist(list,status,hide_title=0)
- div.game_list(class=status)
+mixin gamelist(list,hide_title=0)
+ div.game_list
each item in list
div
- div.game_item(class=item.your_turn ? "your_turn" : "")
+ -
+ let className = "game_item"
+ if (item.your_turn) className += " your_turn"
+ if (item.status === 0 && !item.is_ready) className += " open"
+ else if (item.status === 0 && item.is_ready) className += " ready"
+ else if (item.status === 1 && !item.is_ready) className += " replacement"
+ else if (item.status === 1 && item.is_ready) className += " active"
+ else if (item.status === 2) className += " finished"
+
+ div(class=className)
div.game_head
if item.scenario.length <= 2
div