From 072766b71f9441fdd2796b8dd1137b90acd5a561 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 12 Jun 2022 16:42:33 +0200 Subject: List playing and recently finished games on user pages. --- views/head.pug | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'views/head.pug') 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 -- cgit v1.2.3