Skip to content

Commit

Permalink
Added size parameter to pagination.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbr committed Nov 6, 2014
1 parent 9c475ab commit b8af2d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/basic-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ automatically rendered through the ``render_pagination`` macro::
prev='«',\
next='»',\
ellipses='',\
size=None,\
**kwargs)
Renders a pager for query pagination.
Expand All @@ -201,6 +202,7 @@ automatically rendered through the ``render_pagination`` macro::
``None``, the button will be hidden.
:param ellipses: Symbol/text to use to indicate that pages have been
skipped. If ``None``, no indicator will be printed.
:param size: Can be 'sm' or 'lg' for smaller/larger pagination.
:param kwargs: Extra attributes for the ``<ul>``-element.
.. _forms:

Expand Down
3 changes: 2 additions & 1 deletion flask_bootstrap/templates/bootstrap/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
endpoint=None,
prev=('&laquo;')|safe,
next=('&raquo;')|safe,
size=None,
ellipses='…')
-%}
{% with endpoint = endpoint or request.endpoint %}
<nav>
<ul class="pagination"{{kwargs|xmlattr}}>
<ul class="pagination{% if size %} pagination-{{size}}{% endif %}"{{kwargs|xmlattr}}>
{# prev and next are only show if a symbol has been passed. #}
{% if prev != None -%}
<li {% if not pagination.has_prev %}class="disabled"{% endif %}><a href="{% if pagination.has_prev %}{{url_for(endpoint, page=pagination.prev_num)}}{% else %}#{% endif %}">{{prev}}</li></a>
Expand Down

0 comments on commit b8af2d6

Please sign in to comment.