Skip to content
This repository was archived by the owner on Jul 6, 2018. It is now read-only.

Commit 7a25b44

Browse files
committed
Allow specifying extra css classes for pagination
1 parent 0f4abea commit 7a25b44

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎bootstrap_toolkit/templates/bootstrap_toolkit/pagination.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% with bootstrap_pagination_url=bootstrap_pagination_url|default:"?" %}
22

3-
<div class="pagination">
3+
<div class="pagination {{ css_class_extra }}">
44
<ul>
55

66
<li class="prev{% if current_page == 1 %} disabled{% endif %}">
@@ -33,4 +33,4 @@
3333

3434
</div>
3535

36-
{% endwith %}
36+
{% endwith %}

‎bootstrap_toolkit/templatetags/bootstrap_toolkit.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def bootstrap_pagination(page, **kwargs):
293293
return get_pagination_context(**pagination_kwargs)
294294

295295

296-
def get_pagination_context(page, pages_to_show=11, url=None, extra=None):
296+
def get_pagination_context(page, pages_to_show=11, url=None, css_class_extra="", extra=None):
297297
"""
298298
Generate Bootstrap pagination context from a page object
299299
"""
@@ -362,4 +362,5 @@ def get_pagination_context(page, pages_to_show=11, url=None, extra=None):
362362
'pages_shown': pages_shown,
363363
'pages_back': pages_back,
364364
'pages_forward': pages_forward,
365+
'css_class_extra': css_class_extra,
365366
}

0 commit comments

Comments
 (0)