blob: 9e625b8385f61f0b6be351bf5b601920b18f86bd (
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
|
//- vim:ts=4:sw=4:
doctype html
html
head
include head
title Game Statistics
style.
table { table-layout: fixed; min-width: auto; margin-bottom: 30px; }
td:not(:first-child) { text-align: right; }
th:not(:first-child) { text-align: right; }
td { width: 100px; }
td:first-child { width: 240px; }
body
include header
article
h1 Game Statistics
- function p(t,r) { return r > 0 ? Math.round(r*100/t) + "%" : "" }
- function drawn(x) { return x.total-(x.r1+x.r2+x.r3+x.r4+x.r5+x.r6+x.r7) }
each title in titles
table
thead
tr
th: a(href="/"+title.title_id)= title.title_name
each row in stats
unless row.scenario || row.title_name !== title.title_name
th= row.r1
th= row.r2
th Draw
tbody
each row in stats
if row.scenario && row.title_name === title.title_name
tr
td #{row.scenario} (#{row.total})
td= p(row.total, row.r1)
td= p(row.total, row.r2)
td= p(row.total, drawn(row))
|