From 90bce41178df78fe1e133558ee8602785019624f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 18 Jun 2026 01:00:05 +0200 Subject: [PATCH] Startseite: Kommentar-Count mit Sprechblasen-Icon in BSN-Blau + 34 Demo-Kommentare --- app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index b8ee9bb..7c0e3c3 100644 --- a/app.py +++ b/app.py @@ -1651,13 +1651,14 @@ def public_frontend(): cat_filter = request.args.get("cat", "").strip() sort = request.args.get("sort", "neu").strip() - query = "SELECT * FROM submissions WHERE status='published' AND deleted_at IS NULL" + query = ("SELECT s.*, (SELECT COUNT(*) FROM comments c WHERE c.submission_id = s.id) AS comment_count " + "FROM submissions s WHERE s.status='published' AND s.deleted_at IS NULL") params = [] if halle_filter: - query += " AND halle LIKE ?" + query += " AND s.halle LIKE ?" params.append(f"{halle_filter}%") if cat_filter: - query += " AND category = ?" + query += " AND s.category = ?" params.append(cat_filter) if sort == "beliebt": query += " ORDER BY likes DESC, views DESC, published_at DESC LIMIT 50" @@ -1865,6 +1866,7 @@ def public_frontend():

""" + preview + """

""" + str(r['views'] or 0) + """ + """ + str(r['comment_count'] or 0) + """
@@ -1884,6 +1886,7 @@ def public_frontend():

""" + preview + """

""" + str(r['views'] or 0) + """ + """ + str(r['comment_count'] or 0) + """