diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-23 13:48:12 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-07-23 14:01:19 +0200 |
commit | 34487c1b1920c6a52108a7ed7b390d4b08728ff9 (patch) | |
tree | 112890b6ca8a60868c25e6b0ccca80e6d2ee8800 /views/head.pug | |
parent | c52ca4b709a8752d870a9123b46cfd3764c608a7 (diff) | |
download | server-34487c1b1920c6a52108a7ed7b390d4b08728ff9.tar.gz |
New join page!
* Remove explicit (and redundant) role=Observer parameter.
* Remove old /play/:id redirects.
* Show "private" badge on game boxes.
* Forbid leave/kick in public games.
* Allow "rewind" by owner in public games.
Diffstat (limited to 'views/head.pug')
-rw-r--r-- | views/head.pug | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/views/head.pug b/views/head.pug index 3deb614..e4ff857 100644 --- a/views/head.pug +++ b/views/head.pug @@ -61,10 +61,11 @@ 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.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" + if (item.is_private) pace_icon += EMOJI_PRIVATE + 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" div(class=className) div.game_head @@ -77,25 +78,25 @@ mixin gamelist(list,hide_title=0) case item.status when 0 - a(class="command" href=`/join/${item.game_id}`) Enter + a(class="command" href=`/join/${item.game_id}`) Join when 1 if !item.is_ready - a(class="command" href="/join/"+item.game_id) Enter + a(class="command" href="/join/"+item.game_id) Join else if item.is_yours if item.your_role a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=${encodeURIComponent(item.your_role)}`) Play else - a(class="command" href="/join/"+item.game_id) Enter + a(class="command" href="/join/"+item.game_id) Play else - a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=Observer`) View + a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}`) Watch when 2 if item.is_yours if item.your_role - a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=${encodeURIComponent(item.your_role)}`) Play + a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=${encodeURIComponent(item.your_role)}`) Review else - a(class="command" href="/join/"+item.game_id) Enter + a(class="command" href="/join/"+item.game_id) Review else - a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=Observer`) View + a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}`) Review when 3 | Archived |