From f8ed83a6962ac05a6f07752e554ce513a1d1edca Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 16 Feb 2023 23:50:48 -0600 Subject: [PATCH] explicit context passing --- files/templates/changelog.html | 4 ++-- files/templates/component/sorting_time.html | 2 +- files/templates/home.html | 4 ++-- files/templates/home_comments.html | 4 ++-- files/templates/search.html | 4 ++-- files/templates/submission.html | 4 ++-- files/templates/userpage.html | 4 ++-- files/templates/userpage_comments.html | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/files/templates/changelog.html b/files/templates/changelog.html index 59a046d59..0be252871 100644 --- a/files/templates/changelog.html +++ b/files/templates/changelog.html @@ -1,5 +1,5 @@ {% extends "settings2.html" %} -{%- import 'component/sorting_time.html' as sorting_time with context -%} +{%- import 'component/sorting_time.html' as sorting_time -%} {% block pagetitle %}Changelog{% endblock %} @@ -36,7 +36,7 @@
- {{sorting_time.sort_dropdown(false)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_POSTS)}} {% endblock %} diff --git a/files/templates/component/sorting_time.html b/files/templates/component/sorting_time.html index 41cfd3d5a..1516e1cf8 100644 --- a/files/templates/component/sorting_time.html +++ b/files/templates/component/sorting_time.html @@ -1,4 +1,4 @@ -{%- macro sort_dropdown(is_comment, extra_query) -%} +{%- macro sort_dropdown(sort, t, all_sorts, extra_query='') -%} {% set all_sorts = SORTS_COMMENTS if is_comment else SORTS_POSTS %} {% set ccmode_text = 'ccmode=' . ccmode %} - {{sorting_time.sort_dropdown(false, ccmode_text)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_POSTS, ccmode_text)}} {% endblock %} diff --git a/files/templates/home_comments.html b/files/templates/home_comments.html index bed5b8768..c79f5a487 100644 --- a/files/templates/home_comments.html +++ b/files/templates/home_comments.html @@ -1,5 +1,5 @@ {% extends "default.html" %} -{%- import 'component/sorting_time.html' as sorting_time with context -%} +{%- import 'component/sorting_time.html' as sorting_time -%} {% block sortnav %}{% endblock %} @@ -31,7 +31,7 @@
- {{sorting_time.sort_dropdown(true)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_COMMENTS)}} diff --git a/files/templates/search.html b/files/templates/search.html index 6b0e30a29..a5b9bc5a0 100644 --- a/files/templates/search.html +++ b/files/templates/search.html @@ -1,5 +1,5 @@ {% extends "home.html" %} -{%- import 'component/sorting_time.html' as sorting_time with context -%} +{%- import 'component/sorting_time.html' as sorting_time -%} {% block pagetype %}search{% endblock %} @@ -32,7 +32,7 @@ {% set query_text = 'q=' ~ query | urlencode %} - {{sorting_time.sort_dropdown(false, query_text)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_POSTS, query_text)}} {% endif %} {% endblock %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 79b7b3dbb..761f7d98a 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -1,5 +1,5 @@ {% extends "default.html" %} -{%- import 'component/sorting_time.html' as sorting_time with context -%} +{%- import 'component/sorting_time.html' as sorting_time -%} {% if p.should_hide_score %} {% set ups="" %} @@ -447,7 +447,7 @@
- {{sorting_time.sort_dropdown(true)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_COMMENTS)}} {% if comment_info and p.comment_count >= 2%}

 			
diff --git a/files/templates/userpage.html b/files/templates/userpage.html
index 04c21b064..6078b2367 100644
--- a/files/templates/userpage.html
+++ b/files/templates/userpage.html
@@ -1,5 +1,5 @@
 {% extends "default.html" %}
-{%- import 'component/sorting_time.html' as sorting_time with context -%}
+{%- import 'component/sorting_time.html' as sorting_time -%}
 
 {% block pagetype %}userpage{% endblock %}
 
@@ -593,7 +593,7 @@
 			
- {{sorting_time.sort_dropdown(false)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_POSTS)}}
{% endif %} diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 97429fa49..b8f4890bd 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -1,5 +1,5 @@ {% extends "userpage.html" %} -{%- import 'component/sorting_time.html' as sorting_time with context -%} +{%- import 'component/sorting_time.html' as sorting_time -%} {% block content %} @@ -53,7 +53,7 @@
- {{sorting_time.sort_dropdown(true)}} + {{sorting_time.sort_dropdown(sort, t, SORTS_COMMENTS)}} {% endif %}