{% load param_replace %}
{% load i18n %}

<nav aria-label="Pagination" class="mt-3">
    <ul class="pagination justify-content-center">
        {% if is_paginated %}
            <li class="page-item{% if not page_obj.has_previous %} disabled{% endif %}">
                <a class="page-link"
                        {% if not page_obj.has_previous %}
                   aria-disabled="true" href="#"
                        {% else %}
                   href="?{% param_replace page=page_obj.previous_page_number %}"
                        {% endif %}>
                    <span>&laquo;</span>
                </a>
            </li>
            <li class="page-item">
            <li class="page-item disabled">
                <a class="page-link" aria-disabled="true" href="#">
                    {% blocktranslate trimmed with page=page_obj.number of=page_obj.paginator.num_pages count=page_obj.paginator.count %}
                        Page {{ page }} of {{ of }} ({{ count }} elements)
                    {% endblocktranslate %}
                </a>
            </li>
            <li class="page-item{% if not page_obj.has_next %} disabled{% endif %}">
                <a class="page-link"
                        {% if not page_obj.has_next %}
                   aria-disabled="true" href="#"
                        {% else %}
                   href="?{% param_replace page=page_obj.next_page_number %}"
                        {% endif %}>
                    <span>&raquo;</span>
                </a>
            </li>
        {% else %}
            <li class="page-item disabled">
                <a class="page-link" aria-disabled="true" href="#">
                    {% blocktranslate trimmed with page=page_obj.number of=page_obj.paginator.num_pages count=page_obj.paginator.count %}
                        {{ count }} elements
                    {% endblocktranslate %}
                </a>
            </li>
        {% endif %}
    </ul>
</nav>


