{% if pagination.has_other_pages %}
    <nav class="pagination-container">
        <ul class="pagination justify-content-center">
            {% if pagination.has_previous %}
                <li class="page-item">
                    {% block previous_nav %}
                        <span class="page-link" onclick="redirect_to('{{data.tab}}', '{{pagination.previous_page_number}}')">&laquo;</span>
                    {% endblock %}
                </li>
            {% else %}
                <li class="page-item disabled"><span class="page-link">&laquo;</span></li>
            {% endif %}

            {% if pagination.number|add:'-4' > 1 %}
                <li class="page-item">
                    {% block fast_previous_nav %}
                        <span class="page-link" onclick="redirect_to('{{data.tab}}', '{{ pagination.number|add:'-5' }}')">&hellip;</span>
                    {% endblock %}
                </li>
            {% endif %}

            {% with ''|center:pagination.paginator.num_pages as range %}
            {% for _ in range %}
                {% if pagination.number == forloop.counter %}
                    <li class="page-item active">
                        <span class="page-link">{{ forloop.counter }} <span class="sr-only">(current)</span></span>
                    </li>
                {% elif forloop.counter > pagination.number|add:'-5' and forloop.counter < pagination.number|add:'5' %}
                    <li class="page-item">
                        {% block page_nav %}
                            <span class="page-link" onclick="redirect_to('{{data.tab}}', '{{forloop.counter}}')">{{forloop.counter}}</span>
                        {% endblock %}
                    </li>
                {% endif %}
            {% endfor %}
            {% endwith %}

            {% if pagination.paginator.num_pages > pagination.number|add:'4' %}
                <li class="page-item">
                    {% block fast_next_nav %}
                        <span class="page-link" onclick="redirect_to('{{data.tab}}', '{{ pagination.number|add:'5' }}')">&hellip;</span>
                    {% endblock %}
                </li>
            {% endif %}

            {% if pagination.has_next %}
                <li class="page-item">
                    {% block next_nav %}
                        <span class="page-link" onclick="redirect_to('{{data.tab}}', '{{pagination.next_page_number}}')">&raquo;</span>
                    {% endblock %}
                </li>
            {% else %}
                <li class="page-item disabled"><span class="page-link">&raquo;</span></li>
            {% endif %}
        </ul>
    </nav>
{% endif %}