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