From 6ae624f46e2888bc7560eaf3fab15bba18f710ea Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Sep 2021 04:50:12 +0200 Subject: [PATCH] fd --- files/routes/front.py | 12 +++++++----- files/routes/static.py | 1 + files/templates/leaderboard.html | 6 +++--- files/templates/settings2.html | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index df4574307..07268e922 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -33,14 +33,16 @@ def notifications(v): cids = cids[:25] comments = get_comments(cids, v=v) elif posts: - notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).order_by(Notification.id.desc()).offset(25 * (page - 1)).limit(101) + notifications = v.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).order_by(Notification.id.desc()).offset(25 * (page - 1)).all() comments = [] - for x in notifications: + for index, x in enumerate(notifications): c = x.comment - if not x.read: c.unread = True - x.read = True - g.db.add(x) + if x.read and index > 101: break + elif not x.read: + c.unread = True + x.read = True + g.db.add(x) comments.append(c) next_exists = (len(comments) > 100) listing = comments[:100] diff --git a/files/routes/static.py b/files/routes/static.py index 213a9a783..b5893b91f 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -62,6 +62,7 @@ def participation_stats(v): return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=data) @app.get("/paypigs") +@app.get("/patrons") @auth_desired def patrons(v): query = g.db.query( diff --git a/files/templates/leaderboard.html b/files/templates/leaderboard.html index ef9387554..568ba2e6b 100644 --- a/files/templates/leaderboard.html +++ b/files/templates/leaderboard.html @@ -61,7 +61,7 @@ # Name - Post count + Posts {% for user in users3 %} @@ -86,7 +86,7 @@ # Name - Comment count + Comments {% for user in users4 %} @@ -113,7 +113,7 @@ # Name - Received awards + Awards {% for user in users5 %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 6e664ac47..07a64255c 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -153,7 +153,7 @@ {% endblock %} -
+
{% block content %} {% endblock %}