Created
November 8, 2011 02:53
-
-
Save cspanring/1346879 to your computer and use it in GitHub Desktop.
linaro django pagination template for Bootstrap framework
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
{# use in combination with https://github.com/zyga/django-pagination #} | |
{# and http://twitter.github.com/bootstrap/ #} | |
{# project-dir/templates/pagination/pagination.html #} | |
{% if is_paginated %} | |
{% load i18n %} | |
<div class="pagination"> | |
<ul> | |
{% block previouslink %} | |
{% if page_obj.has_previous %} | |
<li class="prev"><a href="?page{{ page_suffix }}={{ page_obj.previous_page_number }}{{ getvars }}">{{ previous_link_decorator|safe }}{% trans "Previous" %}</a></li> | |
{% else %} | |
{% if display_disabled_previous_link %} | |
<li class="prev disabled"><a>{{ previous_link_decorator|safe }}{% trans "Previous" %}</a></li> | |
{% endif %} | |
{% endif %} | |
{% endblock previouslink %} | |
{% block pagelinks %} | |
{% if display_page_links %} | |
{% for page in pages %} | |
{% if page %} | |
{% ifequal page page_obj.number %} | |
<li class="active"><a href="#">{{ page }}</a></li> | |
{% else %} | |
<li><a href="?page{{ page_suffix }}={{ page }}{{ getvars }}">{{ page }}</a></li> | |
{% endifequal %} | |
{% else %} | |
... | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
{% endblock pagelinks %} | |
{% block nextlink %} | |
{% if page_obj.has_next %} | |
<li class="next"><a href="?page{{ page_suffix }}={{ page_obj.next_page_number }}{{ getvars }}">{% trans "Next" %}{{ next_link_decorator|safe }}</a></li> | |
{% else %} | |
{% if display_disabled_next_link %} | |
<li class="next disabled"><a>{% trans "Next" %}{{ next_link_decorator|safe }}</a></li> | |
{% endif %} | |
{% endif %} | |
{% endblock nextlink %} | |
</ul> | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice! thankx!