From 750224eb7c6537c0b5ecfd40abdebe4bb7a35cb7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Oct 2021 00:10:12 +0200 Subject: [PATCH 1/4] sdffsd --- files/routes/front.py | 9 ++++++--- files/routes/settings.py | 17 +++++++++++------ files/templates/settings_filters.html | 24 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 4aee992e4b..cfe18fd615 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -208,11 +208,14 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' elif sort == "comments": posts = posts.order_by(Submission.comment_count.desc()) - posts = posts.offset(25 * (page - 1)).limit(26).all() + if v: size = v.frontsize + else: size = 25 - next_exists = (len(posts) > 25) + posts = posts.offset(size * (page - 1)).limit(size+1).all() - posts = posts[:25] + next_exists = (len(posts) > size) + + posts = posts[:size] if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts diff --git a/files/routes/settings.py b/files/routes/settings.py index adb7a75fdb..d05a4c7a80 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -169,29 +169,34 @@ def settings_profile_post(v): + frontsize = request.values.get("frontsize") + if frontsize: + if frontsize in ["25", "50", "100"]: + v.frontsize = int(frontsize) + updated = True + cache.delete_memoized(frontlist) + else: abort(400) + defaultsortingcomments = request.values.get("defaultsortingcomments") if defaultsortingcomments: if defaultsortingcomments in ["new", "old", "controversial", "top", "bottom"]: v.defaultsortingcomments = defaultsortingcomments updated = True - else: - abort(400) + else: abort(400) defaultsorting = request.values.get("defaultsorting") if defaultsorting: if defaultsorting in ["hot", "new", "old", "comments", "controversial", "top", "bottom"]: v.defaultsorting = defaultsorting updated = True - else: - abort(400) + else: abort(400) defaulttime = request.values.get("defaulttime") if defaulttime: if defaulttime in ["hour", "day", "week", "month", "year", "all"]: v.defaulttime = defaulttime updated = True - else: - abort(400) + else: abort(400) theme = request.values.get("theme") if theme: diff --git a/files/templates/settings_filters.html b/files/templates/settings_filters.html index deb4c1fdd6..4e92368fc1 100644 --- a/files/templates/settings_filters.html +++ b/files/templates/settings_filters.html @@ -11,6 +11,30 @@
+

Frontpage Size

+ +
+
+
+ +
+ +
+

Change how many posts appear on every page.

+
+ +
+ +
+ +
+
+ +

Default Sorting and Time Filter

From 224216ca1df1d7031084c083d369cd5afa5fb2c3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Oct 2021 00:12:12 +0200 Subject: [PATCH 2/4] dfssdf --- files/templates/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 2001b60709..50246c77d2 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -197,7 +197,7 @@ {{c.author.username}} {% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} - {% if c.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %} +  {{c.age_string}} From 5cfa347b331e16866afa3fb80fd324c82134eadd Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Oct 2021 00:13:55 +0200 Subject: [PATCH 3/4] dsf --- files/templates/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 50246c77d2..2001b60709 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -197,7 +197,7 @@ {{c.author.username}} {% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} - + {% if c.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %}  {{c.age_string}} From 13b3a010a447b3fda48644b5685e32df5acd6208 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Oct 2021 00:17:35 +0200 Subject: [PATCH 4/4] dsfdfs --- files/templates/oauth.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/oauth.html b/files/templates/oauth.html index 11fa9d20d2..ac93dee3ae 100644 --- a/files/templates/oauth.html +++ b/files/templates/oauth.html @@ -23,7 +23,7 @@

It will not be able to see your password, or change your account settings.

-
+