diff --git a/files/helpers/const.py b/files/helpers/const.py index b88be8ad5..3da03891d 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -47,6 +47,7 @@ SORTS_POSTS = { "bump": "fa-arrow-up" } SORTS_POSTS.update(SORTS_COMMON) +SORTS_COMMENTS = SORTS_COMMON IMGUR_KEY = environ.get("IMGUR_KEY").strip() PUSHER_ID = environ.get("PUSHER_ID", "").strip() diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index f315516ae..91ce90ee9 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -86,7 +86,7 @@ def inject_constants(): "PERMS":PERMS, "FEATURES":FEATURES, "RENDER_DEPTH_LIMIT":RENDER_DEPTH_LIMIT, - "SORTS_COMMON":SORTS_COMMON, + "SORTS_COMMENTS":SORTS_COMMENTS, "SORTS_POSTS":SORTS_POSTS, } diff --git a/files/routes/settings.py b/files/routes/settings.py index 4262f52c6..627842559 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -215,7 +215,7 @@ def settings_profile_post(v): defaultsortingcomments = request.values.get("defaultsortingcomments") if defaultsortingcomments: - if defaultsortingcomments in SORTS_COMMON: + if defaultsortingcomments in SORTS_COMMENTS: v.defaultsortingcomments = defaultsortingcomments updated = True else: abort(400) diff --git a/files/templates/component/sorting_time.html b/files/templates/component/sorting_time.html index b76a10455..41cfd3d5a 100644 --- a/files/templates/component/sorting_time.html +++ b/files/templates/component/sorting_time.html @@ -1,12 +1,13 @@ {%- macro sort_dropdown(is_comment, extra_query) -%} +{% set all_sorts = SORTS_COMMENTS if is_comment else SORTS_POSTS %}
Change the default sorting for comments.