Use breadcrumbs and new header button for documents listing view

pull/11720/head
Sage Abdullah 2024-02-29 12:43:47 +00:00 zatwierdzone przez Matt Westcott
rodzic 45484c5da7
commit 89ed36c38c
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -169,7 +169,7 @@ class TestDocumentIndexView(WagtailTestUtils, TestCase):
def test_search_form_rendered(self):
response = self.get()
html = response.content.decode()
search_url = reverse("wagtaildocs:index")
search_url = reverse("wagtaildocs:index_results")
# Search form in the header should be rendered.
self.assertTagInHTML(

Wyświetl plik

@ -68,6 +68,7 @@ class IndexView(generic.IndexView):
model = get_document_model()
add_item_label = gettext_lazy("Add a document")
show_other_searches = True
_show_breadcrumbs = True
def get_base_queryset(self):
# Get documents (filtered by user permission)
@ -130,10 +131,10 @@ class IndexView(generic.IndexView):
return next_url
def get_add_url(self):
# Pass the query string so that the collection filter is preserved
# Pass the collection filter to prefill the add form's collection field
return set_query_params(
super().get_add_url(),
self.request.GET.copy(),
{"collection_id": self.current_collection and self.current_collection.pk},
)
def get_edit_url(self, instance):