Skip to content

Instantly share code, notes, and snippets.

@anishmenon
Created February 1, 2016 09:18
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 anishmenon/f762785a802d7b622e02 to your computer and use it in GitHub Desktop.
Save anishmenon/f762785a802d7b622e02 to your computer and use it in GitHub Desktop.
<!-- PAGINATION SECTION START -->
{% if customers %}
<nav>
<ul class="pagination">
{% if customers.has_previous %}
<li> <a href="?{% for key, values in request.GET.iterlists %}{% ifnotequal key "page" %}{% for value in values%}{{key}}={{value}}&amp;{% endfor %}{% endifnotequal %}{% endfor %}page={{customers.previous_page_number}}" aria-label="Previous"> <span aria-hidden="true">&laquo;</span> </a> </li>
{% endif %}
{%for nums in paginator.page_range|slice:":15" %}
{% if customers.number == nums%}
<li class="m_right_10"><a class="scheme_color" href="?{% for key, values in request.GET.iterlists %}{% ifnotequal key "page" %}{% for value in values%}{{key}}={{value}}&amp;{% endfor %}{% endifnotequal %}{% endfor %}page={{nums}}">{{nums}}</a></li>
{%else%}
<li class="m_right_10"><a class="color_dark" href="?{% for key, values in request.GET.iterlists %}{% ifnotequal key "page" %}{% for value in values%}{{key}}={{value}}&amp;{% endfor %}{% endifnotequal %}{% endfor %}page={{nums}}">{{nums}}</a></li>
{% endif %}
{%endfor%}
{% if customers.has_next %}
<li> <a href="?{% for key, values in request.GET.iterlists %}{% ifnotequal key "page" %}{% for value in values%}{{key}}={{value}}&amp;{% endfor %}{% endifnotequal %}{% endfor %}page={{tries_history.next_page_number}}" aria-label="Next"> <span aria-hidden="true">&raquo;</span> </a> </li>
{% endif %}
</ul>
</nav>
{% endif %}
<!-- PAGINATION SECTION END -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment