diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-05-01 22:04:10 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-05-12 00:21:06 +0200 |
commit | 9f67e66b83d158b99582c2984fc253b6e6abd537 (patch) | |
tree | 9ccd06c22afdafa4607c012f4b99deeb0b87a3c8 /views/head.pug | |
parent | 1eaa2ef7ca02e1534ba5f1baefdc794f675065e0 (diff) | |
download | server-9f67e66b83d158b99582c2984fc253b6e6abd537.tar.gz |
Put account management pages under "/account" URL prefix.
Set logged in user in res.locals for use in pug templates.
Tweak verification flow.
Require password to change name and mail.
Show user statistics on profile (use pug mixin).
Remove "api" prefix on many routes.
Diffstat (limited to 'views/head.pug')
-rw-r--r-- | views/head.pug | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/views/head.pug b/views/head.pug index eec1299..da73d4e 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 |