From e302c62ef232091209c5744c846163b113783ca8 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Fri, 16 Aug 2024 10:32:36 +0100 Subject: [PATCH] Refactor page search view to be closer to universal listings implementation - Use a single class with index_url_name, index_results_url_name, template_name, and results_template_name - Extend generic/listing.html and generic/listing_results.html templates - Set page_title and header_icon to show breadcrumbs properly - Set is_searchable = True and keep using the custom search and filtering logic with the full get_queryset override to prevent scope creep for now --- .../templates/wagtailadmin/pages/search.html | 10 ++-- .../wagtailadmin/pages/search_results.html | 50 +++++++++---------- wagtail/admin/urls/pages.py | 6 ++- wagtail/admin/views/pages/search.py | 29 ++++------- 4 files changed, 42 insertions(+), 53 deletions(-) diff --git a/wagtail/admin/templates/wagtailadmin/pages/search.html b/wagtail/admin/templates/wagtailadmin/pages/search.html index b5ed6b6394..86ecdd40d0 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/search.html +++ b/wagtail/admin/templates/wagtailadmin/pages/search.html @@ -1,6 +1,5 @@ -{% extends "wagtailadmin/base.html" %} +{% extends "wagtailadmin/generic/listing.html" %} {% load wagtailadmin_tags i18n %} -{% block titletag %}{% trans 'Search' %}{% endblock %} {% block extra_js %} {{ block.super }}