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_class = PageTable
table_classname = "listing full-width" table_classname = "listing full-width"
filterset_class = PageFilterSet filterset_class = PageFilterSet
page_title = _("Pages")
index_url_name = None index_url_name = None
index_results_url_name = None index_results_url_name = None
default_ordering = "-latest_revision_created_at" default_ordering = "-latest_revision_created_at"
model = Page model = Page
_show_breadcrumbs = True
columns = [ columns = [
BulkActionsColumn("bulk_actions"), BulkActionsColumn("bulk_actions"),
@ -280,6 +280,9 @@ class IndexView(generic.IndexView):
def get_index_results_url(self): def get_index_results_url(self):
return reverse(self.index_results_url_name) 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): def get_table_kwargs(self):
kwargs = super().get_table_kwargs() kwargs = super().get_table_kwargs()
kwargs["actions_next_url"] = self.index_url kwargs["actions_next_url"] = self.index_url