{% load i18n %}

{% if page_obj.paginator.num_pages > 1 %}
<nav class="flex justify-center my-10" aria-label="{% trans 'pagination.navigation' %}">
    <div class="join">
        {% if page_obj.has_previous %}
        <a class="join-item btn" href="?page=1" aria-label="{% trans 'pagination.first' %}">
            &laquo;
        </a>
        <a class="join-item btn" href="?page={{ page_obj.previous_page_number }}" aria-label="{% trans 'pagination.previous' %}">
            {% trans "pagination.previous" %}
        </a>
        {% endif %}

        <span class="join-item btn btn-active">
            {% blocktrans with number=page_obj.number num_pages=page_obj.paginator.num_pages %}Page {{ number }} of {{ num_pages }}{% endblocktrans %}
        </span>

        {% if page_obj.has_next %}
        <a class="join-item btn" href="?page={{ page_obj.next_page_number }}" aria-label="{% trans 'pagination.next' %}">
            {% trans "pagination.next" %}
        </a>
        <a class="join-item btn" href="?page={{ page_obj.paginator.num_pages }}" aria-label="{% trans 'pagination.last' %}">
            &raquo;
        </a>
        {% endif %}
    </div>
</nav>
{% endif %}
