//- vim:ts=4:sw=4:
doctype html
html
head
include head
title Game Statistics
style.
table { table-layout: fixed; min-width: auto; }
td:not(:nth-child(1)) { text-align: right; }
td:nth-child(1) { width: 240px; }
td { width: 100px; }
tr+tr.blank { height: 2rem; border: none; }
body
include header
article
h1 Game Statistics
table
- 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 row in stats
unless row.scenario
tr.blank
tr
th= row.title_name
th= row.r1
th= row.r2
th Draw
else
tr
td #{row.scenario} (#{row.total})
td= p(row.total, row.r1)
td= p(row.total, row.r2)
td= p(row.total, drawn(row))