From 174146edef5971cd70871c2e87a436c885cb7d77 Mon Sep 17 00:00:00 2001 From: Sage Abdullah Date: Fri, 15 Dec 2023 14:59:24 +0000 Subject: [PATCH] Reuse search_form block from slim_header in page_listing_header.html And rename get_results_url() in pages' BaseIndexView to get_index_results_url to match the method in generic IndexView --- .../templates/wagtailadmin/pages/index.html | 2 +- .../pages/page_listing_header.html | 37 ------------------- wagtail/admin/views/pages/listing.py | 4 +- 3 files changed, 3 insertions(+), 40 deletions(-) diff --git a/wagtail/admin/templates/wagtailadmin/pages/index.html b/wagtail/admin/templates/wagtailadmin/pages/index.html index 3ed51a217f..99859bdfab 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/index.html +++ b/wagtail/admin/templates/wagtailadmin/pages/index.html @@ -4,7 +4,7 @@ {% block header %} {% page_permissions parent_page as parent_page_perms %} - {% include 'wagtailadmin/pages/page_listing_header.html' with title=header_title page_perms=parent_page_perms %} + {% include 'wagtailadmin/pages/page_listing_header.html' with title=header_title search_url=search_url page_perms=parent_page_perms %} {% endblock %} {% block listing %} diff --git a/wagtail/admin/templates/wagtailadmin/pages/page_listing_header.html b/wagtail/admin/templates/wagtailadmin/pages/page_listing_header.html index c42f291fde..c616fe889c 100644 --- a/wagtail/admin/templates/wagtailadmin/pages/page_listing_header.html +++ b/wagtail/admin/templates/wagtailadmin/pages/page_listing_header.html @@ -20,43 +20,6 @@ {% include "wagtailadmin/shared/page_status_tag_new.html" with page=parent_page %} {% endblock %} -{% block search_form %} -
-
- -
-
-{% endblock %} - {% block side_panels %} {% include "wagtailadmin/shared/side_panels.html" with in_explorer=True %} {% endblock side_panels %} diff --git a/wagtail/admin/views/pages/listing.py b/wagtail/admin/views/pages/listing.py index feb15405aa..202bc45ff4 100644 --- a/wagtail/admin/views/pages/listing.py +++ b/wagtail/admin/views/pages/listing.py @@ -280,7 +280,7 @@ class BaseIndexView(generic.IndexView): def get_index_url(self): return reverse("wagtailadmin_explore", args=[self.parent_page.id]) - def get_results_url(self): + def get_index_results_url(self): return reverse("wagtailadmin_explore_results", args=[self.parent_page.id]) def get_history_url(self): @@ -335,7 +335,7 @@ class BaseIndexView(generic.IndexView): "parent_page": self.parent_page, "ordering": self.ordering, "index_url": self.get_index_url(), - "results_url": self.get_results_url(), + "search_url": self.get_index_results_url(), "history_url": self.get_history_url(), "search_form": self.search_form, "is_searching": self.is_searching,