{% comment %}
Paginator template
Author: George Karakostas
Copyright: Copyright 2015, George Karakostas
Licence: BSD-3
Email: gkarak@9-dev.com
{% endcomment %}
{% if is_paginated %}
    <nav class="text-center">
        <ul class="pagination">
            {% if page_obj.has_previous %}
                <li>
                    <a href="{% url this_url %}?page={{ page_obj.previous_page_number }}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            {% else %}
                <li class="disabled">
                    <a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
                </li>
            {% endif %}
            {% for num in page_obj.paginator.page_range %}
                {% if num == page_obj.number %}
                    <li class="active"><a href="#">{{ num }}<span class="sr-only">current</span></a></li>
                {% else %}
                    <li><a href="{% url this_url %}?page={{ num }}">{{ num }}</a></li>
                {% endif %}
            {% endfor %}
            {% if page_obj.has_next %}
                <li>
                    <a href="{% url this_url %}?page={{ page_obj.next_page_number }}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            {% else %}
                <li class="disabled">
                    <a href="#" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
                </li>
            {% endif %}
        </ul>
    </nav>
{% endif %}
