mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 03:31:04 +01:00
Update styleguide to use {% paginate %}
This commit is contained in:
parent
9c01930d93
commit
045e72f2dd
@ -226,7 +226,7 @@
|
||||
|
||||
<section id="pagination">
|
||||
<h2>Pagination</h2>
|
||||
{% include "wagtailadmin/shared/pagination_nav.html" with items=fake_pagination linkurl="wagtailadmin_explore" %}
|
||||
{% paginate example_page %}
|
||||
</section>
|
||||
|
||||
<section id="buttons">
|
||||
|
@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.core.paginator import Paginator
|
||||
from wagtail.wagtailadmin import messages
|
||||
|
||||
from wagtail.wagtailadmin.forms import SearchForm
|
||||
@ -56,19 +57,11 @@ def index(request):
|
||||
messages.button('', _('Edit'))
|
||||
])
|
||||
|
||||
fake_pagination = {
|
||||
'number': 1,
|
||||
'previous_page_number': 1,
|
||||
'next_page_number': 2,
|
||||
'has_previous': True,
|
||||
'has_next': True,
|
||||
'paginator': {
|
||||
'num_pages': 10,
|
||||
},
|
||||
}
|
||||
paginator = Paginator(list(range(100)), 10)
|
||||
page = paginator.page(2)
|
||||
|
||||
return render(request, 'wagtailstyleguide/base.html', {
|
||||
'search_form': form,
|
||||
'example_form': example_form,
|
||||
'fake_pagination': fake_pagination,
|
||||
'example_page': page,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user