summaryrefslogtreecommitdiff
path: root/views/head.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-10 18:50:20 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-13 20:03:41 +0200
commitf642d234d346138552809a9c11357127e15fb0f3 (patch)
tree7588966a09a5049563e4673914de3a9701c04406 /views/head.pug
parent6d5a4328e52a67df35545647e550223a7bf8d9a4 (diff)
downloadserver-f642d234d346138552809a9c11357127e15fb0f3.tar.gz
Handle invites for active games.
Diffstat (limited to 'views/head.pug')
-rw-r--r--views/head.pug6
1 files changed, 5 insertions, 1 deletions
diff --git a/views/head.pug b/views/head.pug
index d9a1364..cffc55a 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -59,6 +59,10 @@ mixin gamelist(list,hide_title=0)
else if (item.pace === 1) pace_icon = EMOJI_LIVE, pace_text = "Live!"
else if (item.pace === 2) pace_icon = EMOJI_FAST, pace_text = "Fast - many moves per day"
else if (item.pace === 3) pace_icon = EMOJI_SLOW, pace_text = "Slow - one move per day"
+ let invite_count = 0
+ for (let p of item.players)
+ if (p.is_invite)
+ invite_count++
div(class=className)
div.game_head
@@ -76,7 +80,7 @@ mixin gamelist(list,hide_title=0)
else
a(class="command" href=`/join/${item.game_id}`) Join
when 1
- if item.join_count !== item.player_count
+ if item.join_count !== item.player_count || invite_count > 0
a(class="command" href="/join/"+item.game_id) Join
else if item.is_yours
if item.your_role