summaryrefslogtreecommitdiff
path: root/views/user_stats.pug
blob: dee288347f8cefbb85289b17de34e355e89a8581 (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
//- vim:ts=4:sw=4:
- let all_won = 0
- let all_total = 0
doctype html
html
	head
		include head
		title Statistics for #{who.name}
	body
		include header
		article
			h1 Statistics for #{who.name}

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

			table(style="min-width:auto")
				thead
					tr
						th Title
						th.r Rating
						th.r Plays
						th.r Last played
				tbody
					each row in ratings
						tr
							td= row.title_name
							td.r= row.rating
							td.r= row.count
							td.r= row.last