kopia lustrzana https://github.com/wagtail/wagtail
Change pagination include on pages index view to match generic listings
rodzic
32ff36446b
commit
77b9ac0582
|
@ -64,9 +64,8 @@
|
|||
|
||||
{% include "wagtailadmin/pages/listing/_list_explore.html" with sortable=1 sortable_by_type=1 full_width=1 show_ordering_column=show_ordering_column show_bulk_actions=show_bulk_actions parent_page=parent_page orderable=parent_page_perms.can_reorder_children show_locale_labels=show_locale_labels %}
|
||||
|
||||
{% if do_paginate %}
|
||||
{% url 'wagtailadmin_explore' parent_page.id as pagination_base_url %}
|
||||
{% paginate page_obj base_url=pagination_base_url %}
|
||||
{% if is_paginated %}
|
||||
{% include "wagtailadmin/shared/pagination_nav.html" with items=page_obj linkurl=index_url %}
|
||||
{% endif %}
|
||||
{% trans "Select all pages in listing" as select_all_text %}
|
||||
{% include 'wagtailadmin/bulk_actions/footer.html' with select_all_obj_text=select_all_text app_label='wagtailcore' model_name='page' objects=pages %}
|
||||
|
|
|
@ -116,6 +116,9 @@ class IndexView(PermissionCheckedMixin, ListView):
|
|||
def paginate_queryset(self, queryset, page_size):
|
||||
return super().paginate_queryset(queryset, page_size)
|
||||
|
||||
def get_index_url(self):
|
||||
return reverse("wagtailadmin_explore", args=[self.parent_page.id])
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
|
@ -137,12 +140,12 @@ class IndexView(PermissionCheckedMixin, ListView):
|
|||
"parent_page": self.parent_page,
|
||||
"ordering": self.ordering,
|
||||
"side_panels": side_panels,
|
||||
"do_paginate": context["is_paginated"],
|
||||
"locale": None,
|
||||
"translations": [],
|
||||
"show_ordering_column": show_ordering_column,
|
||||
"show_bulk_actions": not show_ordering_column,
|
||||
"show_locale_labels": False,
|
||||
"index_url": self.get_index_url(),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue