From 07fe2cd0b6d248a461aa5137ff416c3291eb88b7 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 14 Jun 2021 16:08:17 +0000 Subject: last activity by --- apioforum/forum.py | 2 +- apioforum/static/style.css | 5 +++-- apioforum/templates/view_forum.html | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apioforum/forum.py b/apioforum/forum.py index e5d91f9..83362fc 100644 --- a/apioforum/forum.py +++ b/apioforum/forum.py @@ -14,7 +14,7 @@ def view_forum(): db = get_db() threads = db.execute( """SELECT threads.id, threads.title, threads.creator, threads.created, - threads.updated, count(posts.id) as num_replies + threads.updated, count(posts.id) as num_replies, max(posts.id), posts.author as last_user FROM threads INNER JOIN posts ON posts.thread = threads.id GROUP BY threads.id diff --git a/apioforum/static/style.css b/apioforum/static/style.css index 8457f0e..4273de3 100644 --- a/apioforum/static/style.css +++ b/apioforum/static/style.css @@ -64,15 +64,16 @@ nav a { color: blue; text-decoration: none } .threadlisting:nth-child(even) { background-color: var(--alternating-colour-even) } .threadlisting:nth-child(odd) { background-color: var(--alternating-colour-odd) } + + /* wide screens */ @media all and (min-width: 800px) { .threadlisting { display: contents } .threadlistings { display: grid; - grid-template-columns: 2fr 0.4fr repeat(3, 1fr) 0.4fr; + grid-template-columns: 2fr 0.8fr 1.2fr 1.2fr 0.8fr 0.4fr; } - /* borders */ .threadlisting-part { border-left: 1px solid black; border-top: 1px solid black; diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 3aee2ed..aef01d6 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -14,9 +14,6 @@
name
-
- id -
creator
@@ -26,6 +23,9 @@
last updated
+
+ last activity by +
replies
@@ -33,10 +33,10 @@ {%for thread in threads%}
-
#{{thread.id}}
{{thread.creator}}
{{ts(thread.created)}}
{{ts(thread.updated)}}
+
{{thread.last_user}}
{{thread.num_replies}}
{%endfor%} -- cgit v1.2.3