summaryrefslogtreecommitdiff
path: root/views/user.pug
blob: 06fa91d64439b4f78116634d3173a5c1c7ed06ec (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
//- vim:ts=4:sw=4:
- let open_games = games.filter(game => game.status === 0 && !game.is_match)
- let future_games = games.filter(game => game.status === 0 && game.is_match)
- let active_games = games.filter(game => game.status === 1 && game.is_opposed)
- let solo_games = games.filter(game => game.status === 1 && !game.is_opposed)
- let finished_games = games.filter(game => game.status === 2)
doctype html
html
	head
		include head
		title= who.name
		style.
			.about {
				white-space: pre-wrap;
				font-style: italic;
				padding: 8px 12px;
				border: var(--thin-border);
				box-shadow: var(--drop-shadow);
				background-color: var(--color-text);
			}
	body
		include header
		article
			h1= who.name

			if who.about
				p.about= who.about

			p Member since #{who.ctime}.
			p Last seen #{who.atime}.

			if user && (who.user_id !== user.user_id)
				p
					a(href="/message/send/"+who.name) Send message
					br
					if relation > 0
						a(href="/contacts/remove/"+who.name) Remove from friends
					else if relation < 0
						a(href="/contacts/remove/"+who.name) Remove from blacklist
					else
						a(href="/contacts/add-friend/"+who.name) Add to friends
						br
						a(href="/contacts/add-enemy/"+who.name) Add to blacklist

			+tourlist(null, active_pools, finished_pools)

			if open_games.length > 0
				h2 Invitations
				+gamelist(open_games)

			if active_games.length > 0
				h2 Active
				+gamelist(active_games)

			if solo_games.length > 0
				h2 Solo
				+gamelist(solo_games)

			if future_games.length > 0
				h2 Future
				+gamelist(future_games)

			if finished_games.length > 0
				h2 Recently finished
				+gamelist(finished_games)

			p <a href="/games/finished/#{who.name}">All #{who.name}'s finished games</a>
			p <a href="/tm/finished/#{who.name}">All #{who.name}'s finished tournaments</a>

			if user && user.user_id === 1
				if who.is_banned
					p <a href="/admin/unban-user/#{who.name}">UNBAN USER</a>
				else
					p <a href="/admin/ban-user/#{who.name}">BAN USER</a>