Add page model name as page title for flat page listings

pull/11485/head
Matt Westcott 2024-01-19 19:09:49 +00:00 zatwierdzone przez Sage Abdullah
rodzic 1efe424b93
commit af8330d087
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -138,11 +138,11 @@ class IndexView(generic.IndexView):
table_class = PageTable
table_classname = "listing full-width"
filterset_class = PageFilterSet
page_title = _("Pages")
index_url_name = None
index_results_url_name = None
default_ordering = "-latest_revision_created_at"
model = Page
_show_breadcrumbs = True
columns = [
BulkActionsColumn("bulk_actions"),
@ -280,6 +280,9 @@ class IndexView(generic.IndexView):
def get_index_results_url(self):
return reverse(self.index_results_url_name)
def get_breadcrumbs_items(self):
return self.breadcrumbs_items + [{"url": "", "label": self.get_page_title()}]
def get_table_kwargs(self):
kwargs = super().get_table_kwargs()
kwargs["actions_next_url"] = self.index_url