summaryrefslogtreecommitdiff
path: root/views/join.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-10 00:55:11 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:06:33 +0100
commit36e17b7cc92002d325d7f6fa93767f6189c51444 (patch)
tree80fc9c169bd1df16fe87bc358d40904cf42bd83a /views/join.pug
parent80e3204596f9ab48a350a322e91d78b2a095cf33 (diff)
downloadserver-36e17b7cc92002d325d7f6fa93767f6189c51444.tar.gz
Show "join" page when not logged in.
Static page showing limited info and a call to action to login or sign up.
Diffstat (limited to 'views/join.pug')
-rw-r--r--views/join.pug38
1 files changed, 22 insertions, 16 deletions
diff --git a/views/join.pug b/views/join.pug
index d75ef4d..280e2e6 100644
--- a/views/join.pug
+++ b/views/join.pug
@@ -22,7 +22,7 @@ html
let game = !{ JSON.stringify(game) }
let roles = !{ JSON.stringify(roles) }
let players = !{ JSON.stringify(players) }
- let user_id = !{ user.user_id }
+ let user_id = !{ user ? user.user_id : 0 }
let whitelist = !{ JSON.stringify(whitelist) }
let blacklist = !{ JSON.stringify(blacklist) }
let friends = !{ JSON.stringify(friends) }
@@ -37,13 +37,15 @@ html
else
h1 #{game.title_name} - #{game.scenario}
+ div.logo
+ +gamecover(game.title_id)
+
if limit && game.status < 1
p.error= limit
+ if !user
+ p.error You are not logged in!
p.error#error
- div.logo
- +gamecover(game.title_id)
-
if game.owner_id
if game.is_private
p Created #{game.ctime} by <a class="black" href="/user/#{game.owner_name}">#{game.owner_name}</a> (private).
@@ -54,7 +56,7 @@ html
if game.status > 1
p Finished #{game.mtime}.
- else if game.mtime !== "never"
+ else if game.status > 0
p Last changed #{game.mtime}.
unless game.human_options === "None"
@@ -72,17 +74,18 @@ html
p
i= game.notice
- dialog(id="invite")
- | Invite a friend:
- br
- input(id="invite_user" type="text" list="friends" onchange="send_invite()")
- datalist(id="friends")
- if friends
- each who in friends
- option= who
- br
- button(onclick="send_invite()") Invite
- button(onclick="hide_invite()") Cancel
+ if user
+ dialog(id="invite")
+ | Invite a friend:
+ br
+ input(id="invite_user" type="text" list="friends" onchange="send_invite()")
+ datalist(id="friends")
+ if friends
+ each who in friends
+ option= who
+ br
+ button(onclick="send_invite()") Invite
+ button(onclick="hide_invite()") Cancel
p
table
@@ -98,3 +101,6 @@ html
p
button.hide#delete_button(onclick="confirm_delete()") Delete
button.hide#start_button(onclick="start()" disabled) Start
+
+ if !user && !ready
+ p <a href="/login">Login</a> or <a href="/signup">sign up</a> to play this game.