{% if is_paginated %}
{% load i18n %}
<ul class="pagination">
    {% if page_obj.has_previous %}
        <li><a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}">&laquo;</a></li>
    {% else %}
        <li class="disabled"><a href="#">&laquo;</a></li>
    {% endif %}
    
    {% for page in pages %}
        {% if page %}
            {% if page == page_obj.number %}
                <li class="active"><a href="#">{{ page }} <span class="sr-only">(current)</span></a></li>
            {% else %}
                <li><a href="?page={{ page }}{{ getvars }}{{ hashtag }}">{{ page }}</a></li>
            {% endif %}
        {% else %}
            <li class="disabled"><a href="#">...</a></li>
        {% endif %}
    {% endfor %}
    
    {% if page_obj.has_next %}
        <li><a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}">&raquo;</a></li>
    {% else %}
        <li class="disabled"><a href="#">&raquo;</a></li>
    {% endif %}
</ul>
{% endif %}