Created
January 18, 2013 17:36
-
-
Save jmoz/4566424 to your computer and use it in GitHub Desktop.
Twitter bootstrap HTML with Pagination object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="pagination pagination-right"> | |
<ul> | |
<li{% if not pagination.prev_page %} class="disabled"{% endif %}><a {% if pagination.prev_page %}href="{{ url_for('index', page=pagination.prev_page) }}"{% endif %}>Prev</a></li> | |
{% for page in pagination.pages %} | |
{% set url_paged = url_for('index', page=page) %} | |
{% set url_not_paged = url_for('index') %} | |
<li {% if page == pagination.current_page %}class="active"{% endif %}><a {% if page != pagination.current_page %}href="{% if page == 1 %}{{ url_not_paged }}{% else %}{{ url_paged }}{% endif %}"{% endif %}>{{ page }}</a></li> | |
{% endfor %} | |
<li {% if not pagination.next_page %}class="disabled"{% endif %}><a {% if pagination.next_page %}href="{{ url_for('index', page=pagination.next_page) }}"{% endif %}>Next</a></li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment