From b00a8b7a06980271cb68c983733038ace0647f0f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 5 Oct 2022 12:36:42 +0200 Subject: Track forum thread read/unread status for logged in users. --- views/forum_view.pug | 4 +++- views/message_inbox.pug | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'views') diff --git a/views/forum_view.pug b/views/forum_view.pug index 990d3d3..46c1b1e 100644 --- a/views/forum_view.pug +++ b/views/forum_view.pug @@ -6,6 +6,7 @@ html title Forum meta(http-equiv="refresh" content=3600) style. + .unread { font-weight: bold } tbody a { display: block } body include header @@ -21,7 +22,8 @@ html tbody each row in threads tr - td: a(href="/forum/thread/"+row.thread_id)= row.subject + td(class=row.is_read?"read":"unread") + a(href="/forum/thread/"+row.thread_id)= row.subject td.r= row.count td.w= row.mtime tfoot diff --git a/views/message_inbox.pug b/views/message_inbox.pug index 29bd4d3..10c4626 100644 --- a/views/message_inbox.pug +++ b/views/message_inbox.pug @@ -5,7 +5,7 @@ html include head title Inbox style. - .unread { background-color: lightyellow } + .unread { font-weight: bold } td a { display: block } body include header @@ -23,9 +23,11 @@ html th Date tbody each row in messages - tr(class=row.is_read?"read":"unread") - td: a(href="/user/"+row.from_name)= row.from_name - td: a(href="/message/read/"+row.message_id)= row.subject + tr + td + a(href="/user/"+row.from_name)= row.from_name + td(class=row.is_read?"read":"unread") + a(href="/message/read/"+row.message_id)= row.subject td= row.time else tr -- cgit v1.2.3