summaryrefslogtreecommitdiff
path: root/views/head.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-22 17:32:02 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-27 16:15:44 +0100
commit75566438c2ba942abf3849b724e318cfa050f1ad (patch)
tree84e99d5edb1a8ff3e447a2507706a7759ad88a50 /views/head.pug
parent3e9bc21e757fc13cc8d66cea1d5dcf813f27b4f0 (diff)
downloadserver-75566438c2ba942abf3849b724e318cfa050f1ad.tar.gz
Move more player/game info stuff into SQL.
Update invite_count with triggers. Add games.is_ready generated column. Add games.is_opposed generated column. Add player_view with is_active column.
Diffstat (limited to 'views/head.pug')
-rw-r--r--views/head.pug15
1 files changed, 4 insertions, 11 deletions
diff --git a/views/head.pug b/views/head.pug
index 77ab73b..e47033a 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -61,14 +61,10 @@ mixin gamelist(list,hide_title=0)
else if (item.status === 2) className += " finished"
else if (item.status === 3) className += " archived"
if (item.is_unread) chat_icon = "\u{1f4dd}"
- if (item.pace === 0) pace_icon = "", pace_text = ""
+ if (item.is_match) pace_icon = EMOJI_MATCH
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
@@ -81,12 +77,9 @@ mixin gamelist(list,hide_title=0)
case item.status
when 0
- if item.join_count === item.player_count
- a(class="command" href=`/join/${item.game_id}`) Start
- else
- a(class="command" href=`/join/${item.game_id}`) Join
+ a(class="command" href=`/join/${item.game_id}`) Join
when 1
- if item.join_count !== item.player_count || invite_count > 0
+ if !item.is_ready
a(class="command" href="/join/"+item.game_id) Join
else if item.is_yours
if item.your_role
@@ -124,7 +117,7 @@ mixin gamelist(list,hide_title=0)
when 0
div Created: #{item.ctime}
when 1
- div Changed: #{item.mtime}
+ div Last move: #{item.mtime}
when 2
div Finished: #{item.mtime}
div Result: !{item.result}