summaryrefslogtreecommitdiff
path: root/views/stats.pug
blob: ececb8553335be8055804c4a2d7653b7d128f9e9 (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
//- vim:ts=4:sw=4:
doctype html
html
	head
		include head
		title Game Statistics
		style.
			table { margin-bottom: 30px; }
			td:not(:first-child) { text-align: right; }
			th:not(:first-child) { text-align: right; }
			td:not(:first-child) { width: 50px; }
	body
		include header
		article
			h1 Game Statistics
			- function p(t,r) { return r > 0 ? Math.round(r*100/t) + "%" : "" }
			each row in stats
				table.half.striped
					thead
						tr
							th
								a.black(href="/"+row.title_id)= row.title_name
								unless row.scenario === "Standard"
									|  – #{row.scenario}
							th= row.total
					tbody
						- for (let i=0; i<row.result_role.length; ++i)
							- let role = row.result_role[i]
							- let count = row.result_count[i]
							tr
								td= role
								td= p(row.total,count)