summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/forum.py2
-rw-r--r--apioforum/static/style.css5
-rw-r--r--apioforum/templates/view_forum.html8
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 @@
<div class="threadlisting-part threadlisting-part-title threadlisting-header">
name
</div>
- <div class="threadlisting-part threadlisting-part-id threadlisting-header">
- id
- </div>
<div class="threadlisting-part threadlisting-part-creator threadlisting-header">
creator
</div>
@@ -26,6 +23,9 @@
<div class="threadlisting-part threadlisting-part-updated threadlisting-header">
last updated
</div>
+ <div class="threadlisting-part threadlisting-part-lastactivityby threadlisting-header">
+ last activity by
+ </div>
<div class="threadlisting-part threadlisting-part-numreplies threadlisting-header">
replies
</div>
@@ -33,10 +33,10 @@
{%for thread in threads%}
<div class="threadlisting">
<div class="threadlisting-part threadlisting-part-title"><a href="{{url_for('thread.view_thread',thread_id=thread.id)}}">{{thread.title}}</a></div>
- <div class="threadlisting-part threadlisting-part-id">#{{thread.id}}</div>
<div class="threadlisting-part threadlisting-part-creator">{{thread.creator}}</div>
<div class="threadlisting-part threadlisting-part-created">{{ts(thread.created)}}</div>
<div class="threadlisting-part threadlisting-part-updated">{{ts(thread.updated)}}</div>
+ <div class="threadlisting-part threadlisting-part-lastactivityby">{{thread.last_user}}</div>
<div class="threadlisting-part threadlisting-part-numreplies">{{thread.num_replies}}</div>
</div>
{%endfor%}