{% load pagination_tags %}

{% include 'django_spire/element/divider_element.html' %}
<div class="row justify-content-between pb-1">
    <div class="col-auto ps-4">
        <span class="opacity-50 text-blac">
            Page {{ paginated_list.number }} of {{ paginated_list.paginator.num_pages }}
        </span>
    </div>

    <div class="col-auto pe-4">
        <div class="pagination">
            <span class="step-links">
                {% if paginated_list.has_previous %}
                    <a href="?page=1">
                        &laquo; first |
                    </a>
                {% endif %}

                {% get_elided_page_range paginated_list as page_range %}
                {% for i in page_range %}
                    {% if paginated_list.number == i %}
                        <span class="current">
                            {{ paginated_list.number }} |
                        </span>
                    {% else %}
                        {% if i == paginated_list.paginator.ELLIPSIS %}
                            <span>
                                {{ paginated_list.paginator.ELLIPSIS }} |
                            </span>
                        {% else %}
                            <a href="?page={{ i }}">
                                {{ i }} |
                            </a>
                        {% endif %}
                    {% endif %}
                {% endfor %}

                {% if paginated_list.has_next %}
                    <a href="?page={{ paginated_list.paginator.num_pages }}">
                        last &raquo;
                    </a>
                {% endif %}
            </span>
        </div>
    </div>
</div>
