summaryrefslogtreecommitdiff
path: root/views/user_stats.pug
blob: 865e7fdaa1fba22267b3bbe0dac6bb96e256c35c (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
//- vim:ts=4:sw=4:
- let all_won = 0
- let all_total = 0
doctype html
html
	head
		include head
		title Stats for #{who.name}
		style td:nth-child(n+4){text-align:right}
	body
		include header
		article
			h1 Stats for #{who.name}

			table(style="min-width:auto")
				tr
					th Title
					th Scenario
					th Role
					th Played
					th Won
				each row in stats
					tr
						- all_won += row.won
						- all_total += row.total
						td= row.title_name
						td= row.scenario
						td= row.role
						td= row.total
						td= Math.round(row.won*100/row.total) + "%"
				tr
					th
					th
					th
					th
					th
				tr
					td
					td
					td
					td= all_total
					td= Math.round(all_won*100/all_total) + "%"