0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Update styleguide to use {% paginate %}

This commit is contained in:
Tim Heap 2015-07-16 18:42:04 +10:00 committed by Matt Westcott
parent 9c01930d93
commit 045e72f2dd
2 changed files with 5 additions and 12 deletions

View File

@ -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">

View File

@ -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,
})