From fcf1a67f1ecc93b8ed0fe33d2543216cde8b49e5 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 19 Jan 2024 19:30:07 +0000 Subject: [PATCH] Leave out the page type filter from flat page listings by default --- wagtail/admin/views/pages/listing.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wagtail/admin/views/pages/listing.py b/wagtail/admin/views/pages/listing.py index 5aeba71bd6..f352b61cef 100644 --- a/wagtail/admin/views/pages/listing.py +++ b/wagtail/admin/views/pages/listing.py @@ -68,11 +68,6 @@ class EditedByFilter(MultipleUserFilter): class PageFilterSet(WagtailFilterSet): - content_type = MultipleContentTypeFilter( - label=_("Page type"), - queryset=lambda request: get_page_content_types(include_base_page_type=False), - widget=CheckboxSelectMultiple, - ) latest_revision_created_at = DateFromToRangeFilter( label=_("Date updated"), widget=DateRangePickerWidget, @@ -120,6 +115,14 @@ class PageFilterSet(WagtailFilterSet): fields = [] # only needed for filters being generated automatically +class ExplorablePageFilterSet(PageFilterSet): + content_type = MultipleContentTypeFilter( + label=_("Page type"), + queryset=lambda request: get_page_content_types(include_base_page_type=False), + widget=CheckboxSelectMultiple, + ) + + class IndexView(generic.IndexView): template_name = "wagtailadmin/pages/index.html" results_template_name = "wagtailadmin/pages/index_results.html" @@ -308,6 +311,7 @@ class ExplorableIndexView(IndexView): index_url_name = "wagtailadmin_explore" index_results_url_name = "wagtailadmin_explore_results" page_title = _("Exploring") + filterset_class = ExplorablePageFilterSet columns = ( IndexView.columns[0:3]