From f642d234d346138552809a9c11357127e15fb0f3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 10 Oct 2023 18:50:20 +0200 Subject: Handle invites for active games. --- views/head.pug | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'views') 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 -- cgit v1.2.3