{% if is_paginated %}
{% load i18n %}
<div class="pagination">
    <ul>
        {% if page_obj.has_previous %}
            <li>
                <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">&laquo; {% trans "previous" %}</a>
            </li>
        {% else %}
            <li class="disabled">
                <a>&laquo; {% trans "previous" %}</a>
            </li>
        {% endif %}
        {% for page in pages %}
            {% if page %}
                {% ifequal page page_obj.number %}
                <li class="active">
                    <a>{{ page }}</a>
                </li>
                {% else %}
                <li>
                    <a href="?page={{ page }}{{ getvars }}{{ hashtag }}">{{ page }}</a>
                </li>
                {% endifequal %}
            {% else %}
                <li>
                    <a>...</a>
                </li>
            {% endif %}
        {% endfor %}
        {% if page_obj.has_next %}
            <li>
                <a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next">{% trans "next" %} &raquo;</a>
            </li>
        {% else %}
            <li class="disabled">
                <a class="disabled next">{% trans "next" %} &raquo;</a>
            </li>
        {% endif %}
    </ul>
</div>
{% endif %}