{% load i18n %}
{% spaceless %}
<nav aria-label="...">
    <ul class="pagination{% if extra_class %} {{ extra_class }}{% endif %}">
        {% if page.has_previous %}
        <li class="page-item">
            <a href="{{ prev_page_url }}" class="page-link">
            {% if text_labels %}
                {% trans "Previous" %}
            {% else %}
                &laquo;
            {% endif %}
            </a>
        </li>
        {% else %}
        <li class="page-item disabled">
            <a class="page-link" href="#" tabindex="-1">
            {% if text_labels %}
                {% trans "Previous" %}
            {% else %}
                &laquo;
            {% endif %}
            </a>
        </li>
        {% endif %}
        {% for page_num, url in pages %}
            {% if page_num == current %}
            <li class="page-item active">
                <a class="page-link" href="#">{{ page_num }}<span class="sr-only">(current)</span></a>
            </li>
            {% elif page_num %}
            <li>
                <a href="{{ url }}" class="page-link">{{ page_num }}</a>
            </li>
            {% else %}
            <li class="page-item disabled">
                <a class="page-link" href="#" tabindex="-1">&#8230;</a>
            </li>
        {% endif %}
        {% endfor %}

        {% if page.has_next %}
        <li class="page-item">
            <a href="{{ next_page_url }}" class="page-link">
            {% if text_labels %}
                {% trans "Next" %}
            {% else %}
                &raquo;
            {% endif %}
            </a>
        </li>
        {% else %}
        <li class="page-item disabled">
            <a class="page-link" href="#" tabindex="-1">
            {% if text_labels %}
                {% trans "Next" %}
            {% else %}
                &raquo;
            {% endif %}
            </a>
        </li>
        {% endif %}
    </ul>
</nav>
{% endspaceless %}
