{% load i18n %}

{% if is_paginated %}
<div class="pagination">
    <ul>
        {% if page_obj.has_previous %}
            <li class="prev">
                <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}">← {% trans "Previous" %}</a>
            </li>
        {% else %}
            <li class="prev disabled"><a>← {% trans "Previous" %}</a></li>
        {% endif %}
        {% for page in pages %}
            {% if page %}
                <li class="{% ifequal page page_obj.number %}active{% endifequal %}"><a href="?page={{ page }}{{ getvars }}{{ hashtag }}">{{ page }}</a></li>
            {% else %}
                <li class="disabled"><a href="#">…</a></li>
            {% endif %}
        {% endfor %}
        {% if page_obj.has_next %}
            <li class="next"><a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}">{% trans "Next" %} →</a></li>
        {% else %}
            <li class="next disabled"><a>{% trans "Next" %} →</a></li>
        {% endif %}
    </ul>
</div>
{% endif %}