Skip to content

Instantly share code, notes, and snippets.

@jmoz
Created January 18, 2013 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoz/4566424 to your computer and use it in GitHub Desktop.
Save jmoz/4566424 to your computer and use it in GitHub Desktop.
Twitter bootstrap HTML with Pagination object.
<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