Skip to content

Instantly share code, notes, and snippets.

@TimFletcher
Created September 15, 2010 17:05
Show Gist options
  • Save TimFletcher/581062 to your computer and use it in GitHub Desktop.
Save TimFletcher/581062 to your computer and use it in GitHub Desktop.
{% if is_paginated %}
<div class="pagination">
{% for p in paginator.page_range %}
{% if forloop.first %}{% if page_obj.has_previous %}<a href ="?page={{ page_obj.previous_page_number }}" id="previous">&laquo; previous</a>{% endif %}{% endif %}
<span{% ifequal page_obj.number p %} class="current"{% endifequal %}><a href="?page={{ p }}" >{{ p }}</a></span>
{% if forloop.last %}{% if page_obj.has_next %}<a href ="?page={{ page_obj.next_page_number }}" id="next">next &raquo;</a>{% endif %}{% endif %}
{% endfor %}
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment