summaryrefslogtreecommitdiff
path: root/views/head.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-13 22:23:59 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-13 22:23:59 +0200
commit22d96bbd8d2f3c63328e0beb4e192eb9bf3d5ce3 (patch)
tree659ba958d21f3b3455b3a603111b861da3c14b69 /views/head.pug
parentede55b317dea7915f4ced8b628d2b31262dc2847 (diff)
downloadserver-22d96bbd8d2f3c63328e0beb4e192eb9bf3d5ce3.tar.gz
Format human dates in view templates rather than in server queries.
Diffstat (limited to 'views/head.pug')
-rw-r--r--views/head.pug12
1 files changed, 6 insertions, 6 deletions
diff --git a/views/head.pug b/views/head.pug
index 66e3f58..d9da995 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -28,10 +28,10 @@ mixin forumpost(row,show_buttons)
.post(id=row.post_id)
.head
.from: b: a.black(href="/user/"+row.author_name)= row.author_name
- .time= row.ctime
+ .time= human_date(row.ctime)
if row.edited
|
- | (edited #{row.mtime})
+ | (edited #{human_date(row.mtime)})
.body!= row.body
if show_buttons && user
.edit
@@ -120,9 +120,9 @@ mixin gamelist(list,hide_title=0)
div Players: <span class="error">Nobody</span>
case item.status
when 0
- div Created: #{item.ctime}
+ div Created: #{human_date(item.ctime)}
when 1
- div Last move: #{item.mtime}
+ div Last move: #{human_date(item.mtime)}
if item.your_turn
if item.time_left <= 0
div Time left: none.
@@ -131,10 +131,10 @@ mixin gamelist(list,hide_title=0)
else if item.time_left <= 5
div Time left: #{ item.time_left | 0 } days
when 2
- div Finished: #{item.mtime}
+ div Finished: #{human_date(item.mtime)}
div Result: !{item.result}
when 3
- div Finished: #{item.mtime}
+ div Finished: #{human_date(item.mtime)}
div Result: !{item.result}
unless hide_title
a(href=`/${item.title_id}`)