kopia lustrzana https://github.com/wagtail/wagtail
adopt `classname` naming in paginate template tag
rodzic
6cf16bf5d5
commit
044c7b4b73
|
@ -25,4 +25,4 @@
|
|||
{% component table %}
|
||||
|
||||
{% url 'wagtailadmin_choose_page_child' parent_page.id as pagination_base_url %}
|
||||
{% paginate pagination_page base_url=pagination_base_url classnames="navigate-pages" %}
|
||||
{% paginate pagination_page base_url=pagination_base_url classname="navigate-pages" %}
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
{% component table %}
|
||||
|
||||
{% url 'wagtailadmin_choose_page_search' as pagination_base_url %}
|
||||
{% paginate pages base_url=pagination_base_url classnames="navigate-pages" %}
|
||||
{% paginate pages base_url=pagination_base_url classname="navigate-pages" %}
|
||||
{% endif %}
|
||||
|
|
|
@ -11,7 +11,7 @@ Pagination for page listings. Used by the `{% paginate %}` template tag.
|
|||
<ul>
|
||||
<li class="prev">
|
||||
{% if page.has_previous %}
|
||||
<a data-page="{{ page.previous_page_number }}" href="{{ base_url }}{% pagination_querystring page.previous_page_number page_key=page_key %}" class="{{ classnames }}">
|
||||
<a data-page="{{ page.previous_page_number }}" href="{{ base_url }}{% pagination_querystring page.previous_page_number page_key=page_key %}" class="{{ classname }}">
|
||||
{% icon name="arrow-left" class_name="default" %}
|
||||
{% trans "Previous" %}
|
||||
</a>
|
||||
|
@ -19,7 +19,7 @@ Pagination for page listings. Used by the `{% paginate %}` template tag.
|
|||
</li>
|
||||
<li class="next">
|
||||
{% if page.has_next %}
|
||||
<a data-page="{{ page.next_page_number }}" href="{{ base_url }}{% pagination_querystring page.next_page_number page_key=page_key %}" class="{{ classnames }}">
|
||||
<a data-page="{{ page.next_page_number }}" href="{{ base_url }}{% pagination_querystring page.next_page_number page_key=page_key %}" class="{{ classname }}">
|
||||
{% trans "Next" %}
|
||||
{% icon name="arrow-right" class_name="default" %}
|
||||
</a>
|
||||
|
|
|
@ -444,7 +444,7 @@ def pagination_querystring(context, page_number, page_key="p"):
|
|||
@register.inclusion_tag(
|
||||
"wagtailadmin/pages/listing/_pagination.html", takes_context=True
|
||||
)
|
||||
def paginate(context, page, base_url="", page_key="p", classnames=""):
|
||||
def paginate(context, page, base_url="", page_key="p", classname=""):
|
||||
"""
|
||||
Print pagination previous/next links, and the page count. Take the
|
||||
following arguments:
|
||||
|
@ -461,13 +461,13 @@ def paginate(context, page, base_url="", page_key="p", classnames=""):
|
|||
page_key
|
||||
The name of the page variable in the query string. Defaults to 'p'.
|
||||
|
||||
classnames
|
||||
classname
|
||||
Extra classes to add to the next/previous links.
|
||||
"""
|
||||
request = context["request"]
|
||||
return {
|
||||
"base_url": base_url,
|
||||
"classnames": classnames,
|
||||
"classname": classname,
|
||||
"request": request,
|
||||
"page": page,
|
||||
"page_key": page_key,
|
||||
|
|
Ładowanie…
Reference in New Issue