summaryrefslogtreecommitdiff
path: root/views/stats_user.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-05-06 20:25:36 +0200
committerTor Andersson <tor@ccxvii.net>2025-05-08 12:27:31 +0200
commit83949e45c0f3abfba5432a4bdf38e2fc744afec2 (patch)
tree2bf71850e6afe5c954515edcc110f7c91cf6d7f2 /views/stats_user.pug
parent4fabe52169e718af25b407533d775da3f3192015 (diff)
downloadserver-83949e45c0f3abfba5432a4bdf38e2fc744afec2.tar.gz
Remove "api" prefix on many routes.
Diffstat (limited to 'views/stats_user.pug')
-rw-r--r--views/stats_user.pug53
1 files changed, 53 insertions, 0 deletions
diff --git a/views/stats_user.pug b/views/stats_user.pug
new file mode 100644
index 0000000..3b201ef
--- /dev/null
+++ b/views/stats_user.pug
@@ -0,0 +1,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.striped
+ 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.striped
+ 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