summaryrefslogtreecommitdiff
path: root/views/stats.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-02-14 13:22:14 +0100
committerTor Andersson <tor@ccxvii.net>2022-02-15 12:18:30 +0100
commitf6b774bd88a4249190ea1d304495e5e086e02ac7 (patch)
tree31e56eabe897582d998fddb137c6db335e73fc15 /views/stats.pug
parent31f125a65d9e724ca587949bdc820f85c6361ffe (diff)
downloadserver-f6b774bd88a4249190ea1d304495e5e086e02ac7.tar.gz
Drop table roles.
Diffstat (limited to 'views/stats.pug')
-rw-r--r--views/stats.pug35
1 files changed, 17 insertions, 18 deletions
diff --git a/views/stats.pug b/views/stats.pug
index 9e625b8..65649b3 100644
--- a/views/stats.pug
+++ b/views/stats.pug
@@ -5,32 +5,31 @@ html
include head
title Game Statistics
style.
- table { table-layout: fixed; min-width: auto; margin-bottom: 30px; }
+ table { 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; }
+ td:not(:first-child) { width: 50px; }
+ td:first-child { width: 400px; }
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
+ each row in stats
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
+ th
+ a(href="/"+row.title_id)= row.title_name
+ unless row.scenario === "Standard"
+ | , #{row.scenario}
+ unless row.options === "None"
+ | , #{row.options}
+ th= row.total
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))
+ - 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)