diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-01-02 17:59:07 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-01-06 12:40:25 +0100 |
commit | 74166074606cdba810b1b42f87af8cbe0bab6519 (patch) | |
tree | b88170560eb9dcd584766c300792fb6457ee91de /views/head.pug | |
parent | 72ebf85bc7f3a5f8fdf37e96a319ccbb8ea5768d (diff) | |
download | server-74166074606cdba810b1b42f87af8cbe0bab6519.tar.gz |
Add game replay functionality.
Handle missing replay data.
Add replay/rematch/exit buttons on game-over.
Set 'player' to active player during replays.
Replace space with underscore in role class names.
Fix critical undo bug!
Set game_over state during replays.
Fix jumpy view in battle replays.
Nuke undo states from all actions, not just 'undo'.
Log play and replay page requests.
Clean up client.js and allow selecting replay viewpoint.
Add debug mode to replay prompt showing active, state, and next action.
Init client roles from HTML structure.
Remove unused rematch functions.
Drop /info/ prefix on game pages.
Update body role classList when replay viewpoint changes.
Diffstat (limited to 'views/head.pug')
-rw-r--r-- | views/head.pug | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/views/head.pug b/views/head.pug index 68fa904..df1b762 100644 --- a/views/head.pug +++ b/views/head.pug @@ -15,7 +15,7 @@ mixin social(title,description,game) meta(property="og:description" content=description) mixin gamecover(title_id) - a(href="/info/"+title_id) + a(href="/"+title_id) img(src=`/${title_id}/cover.1x.jpg` srcset=`/${title_id}/cover.2x.jpg 2x`) mixin forumpost(row,show_buttons) @@ -57,7 +57,7 @@ mixin gametable(status,table,hide_title=0) tr td= row.game_id unless hide_title - td.w: a(href="/info/"+row.title_id)= row.title_name + td.w: a(href="/"+row.title_id)= row.title_name td.w= row.scenario td!= row.player_names td= row.description @@ -76,15 +76,16 @@ mixin gametable(status,table,hide_title=0) td.command if status === 0 a(href="/join/"+row.game_id) Join - else - - let cmd = status === 1 ? "Play" : "View" + else if status === 1 if row.is_yours if row.is_shared - a(href="/join/"+row.game_id)= cmd + a(href="/join/"+row.game_id)= "Play" else - a(href=`/${row.title_id}/play:${row.game_id}:${row.your_role}`)= cmd + a(href=`/${row.title_id}/play:${row.game_id}:${row.your_role}`)= "Play" else a(href=`/${row.title_id}/play:${row.game_id}`) View + else if status >= 2 + a(href=`/${row.title_id}/replay:${row.game_id}`) View else tr case status |