summaryrefslogtreecommitdiff
path: root/views/join.pug
blob: 0f9daef1fb2167957aed05090f0b1a045163de18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//- vim:ts=4:sw=4:
doctype html
html
	head
		include head
		+social(game.title_name,
			"Play " + game.title_name + " with " + players.map(x=>x.name).join(" and ") + ".",
			game.title_id)
		title= game.title_name
		style.
			table { min-width: 0; }
			th,td { border: 1px solid black; }
			td a.red { text-decoration: none; color: brown; font-size: 15px; float: right; }
			td a.green { text-decoration: none; color: green; font-size: 15px; float: right; }
			td a { text-decoration: underline; color: blue; }
			th { white-space: nowrap; background-color: gainsboro; }
			td { width: 180px; background-color: white; }
			#message { background-color: whitesmoke; }
			.hide { display: none; }
			td.is_invite { color: gray }
			td.enemy { background-color: #f66 }
			td.enemy::before { content: "\1f6ab    "; color: #000; font-size: 15px; }
		script.
			let game = !{ JSON.stringify(game) }
			let roles = !{ JSON.stringify(roles) }
			let players = !{ JSON.stringify(players) }
			let user_id = !{ user.user_id }
			let whitelist = !{ JSON.stringify(whitelist) }
			let blacklist = !{ JSON.stringify(blacklist) }
			let friends = !{ JSON.stringify(friends) }
			let ready = !{ ready }
		script(src="/join.js")
	body
		include header
		article
			h1= game.title_name
			p.error#error

			div.logo
				+gamecover(game.title_id)

			div Scenario: #{game.scenario}

			unless game.human_options === "None"
				div Options: #{game.human_options}
			div
				if game.is_private
					| Owner: <a href="/user/#{game.owner_name}">#{game.owner_name}</a> (private)
				else
					| Owner: <a href="/user/#{game.owner_name}">#{game.owner_name}</a>

			div Created: #{game.ctime}
			unless game.mtime === "never"
				div Changed: #{game.mtime}

			if game.status === 2
				div Result: #{game.result}

			if game.notice
				br
				div
					i= game.notice

			br(clear="left")

			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
				tbody
					each role in roles
						tr
							th(id="role_"+role.replace(/ /g, "_")+"_name")= role
							td.command(id="role_"+role.replace(/ /g, "_")) -
					tr
						td.command#message(colspan=2) -

			p
				button.hide#delete_button(onclick="confirm_delete()") Delete
				button.hide#start_button(onclick="start()" disabled) Start