summaryrefslogtreecommitdiff
path: root/views/head.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-05-06 20:01:42 +0200
committerTor Andersson <tor@ccxvii.net>2025-05-06 20:08:41 +0200
commit2d22fd6f23e2afe24b64e4b8ab09bf1b5404e3e4 (patch)
tree6dfff0874c64aa7ebb2c9b6d56467e75691e3044 /views/head.pug
parent5c671661d4ec0b54ee0d7e5ccd4dcc4aff42d079 (diff)
downloadserver-2d22fd6f23e2afe24b64e4b8ab09bf1b5404e3e4.tar.gz
Show user statistics on profile (use pug mixin).
Diffstat (limited to 'views/head.pug')
-rw-r--r--views/head.pug33
1 files changed, 33 insertions, 0 deletions
diff --git a/views/head.pug b/views/head.pug
index 3707757..20fb9aa 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -212,3 +212,36 @@ mixin tourlist(seeds, pools, fin)
+poollist(pools, "Active", TM_ICON_ACTIVE)
div
+poollist(fin, "Finished", TM_ICON_FINISHED)
+
+mixin userstats(who, ratings)
+ if (who.move_time_mean !== null)
+ h3 Response time
+ div Average response time: #{format_minutes(who.move_time_mean)}
+ if (who.move_time_q2 !== null)
+ div Median response time: #{format_minutes(who.move_time_q2)}
+ if (who.move_time_q1 !== null && who.move_time_q2 !== null)
+ div Middle half of response times: #{format_minutes(who.move_time_q1)} to #{format_minutes(who.move_time_q3)}
+
+ h3 Timeouts
+ div Total number of timeouts: #{who.timeout_total}
+ div Games completed since last timeout: #{who.games_since_timeout}
+
+ if ratings.length > 0
+ h3 Most played games
+ table
+ thead
+ tr
+ th Title
+ th Count
+ th Last played
+ if user && user.user_id === 1
+ th Elo
+ tbody
+ each row in ratings
+ tr
+ td
+ a.black(href="/" + row.title_id)= row.title_name
+ td.r= row.count
+ td.r= row.last
+ if user && user.user_id === 1
+ td.r= row.rating