From e8949bbffdd0063068a44e75e433e8128750b3bd Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 6 Aug 2023 15:17:29 -0700 Subject: [PATCH] Make sure defaults are set on directory filters --- bookwyrm/templates/directory/community_filter.html | 4 ++-- bookwyrm/templates/directory/sort_filter.html | 4 ++-- bookwyrm/views/directory.py | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bookwyrm/templates/directory/community_filter.html b/bookwyrm/templates/directory/community_filter.html index 91783fd36..3d101fcee 100644 --- a/bookwyrm/templates/directory/community_filter.html +++ b/bookwyrm/templates/directory/community_filter.html @@ -4,11 +4,11 @@ {% block filter %} {% trans "Community" %} {% endblock %} diff --git a/bookwyrm/templates/directory/sort_filter.html b/bookwyrm/templates/directory/sort_filter.html index 344366016..5de7d6a10 100644 --- a/bookwyrm/templates/directory/sort_filter.html +++ b/bookwyrm/templates/directory/sort_filter.html @@ -6,8 +6,8 @@
diff --git a/bookwyrm/views/directory.py b/bookwyrm/views/directory.py index 81898af26..7b2ee78b5 100644 --- a/bookwyrm/views/directory.py +++ b/bookwyrm/views/directory.py @@ -19,7 +19,7 @@ class Directory(View): software = request.GET.get("software") if not software or software == "bookwyrm": filters["bookwyrm_user"] = True - scope = request.GET.get("scope") + scope = request.GET.get("scope", "federated") if scope == "local": filters["local"] = True @@ -38,6 +38,8 @@ class Directory(View): page.number, on_each_side=2, on_ends=1 ), "users": page, + "sort": sort, + "scope": scope, } return TemplateResponse(request, "directory/directory.html", data)