{% if list.pages > 1 %}
    {% set currentPage = request.page|default(1) %}
    {% set paginator = guest.system_paginator({ 'total': list.total, 'page': currentPage, 'per_page': list.per_page }) %}
    <ul class="pagination m-0">
        {% if paginator.currentpage != 1 %}
        <li class="page-item">
            <a class="page-link" href="{{ url|alink({}|merge(request)|slice(1,request|length)|merge({ 'page': currentPage-1 })) }}">
                <svg class="icon">
                    <use xlink:href="#chevron-left" />
                </svg>
            </a>
        </li>
        {% endif %}
        {% if (paginator.range.0 != 1) %}
            <li class="page-item">
                <a class="page-link" href="{{ url|alink({ 'page': 1 }) }}">1</a>
            </li>
        {% endif %}
        {% for i in paginator.start..paginator.end %}
            {% if paginator.range.0 > 2 and i == paginator.range.0 %}
                ...
            {% endif %}

            {% if i == paginator.currentpage %}
                <li class="page-item active">
                    <a class="page-link" href="#" onclick="return false;">{{ i }}</a>
                </li>
            {% else %}
                <li class="page-item">
                    <a class="page-link" href="{{ url|alink({}|merge(request)|slice(1, request|length)|merge({ 'page': i })) }}"> {{ i }}</a>
                </li>
            {% endif %}
        {% endfor %}

        {% if paginator.range[paginator.midrange -1] < paginator.numpages -1 and paginator.end == paginator.range[paginator.midrange-1] %}
            ...
            <li class="page-item">
                <a class="page-link" href="{{ url|alink({}|merge(request)|slice(1,request|length)|merge({ 'page': paginator.numpages })) }}"> {{ paginator.numpages }}</a>
            </li>
        {% endif %}

        {% if paginator.currentpage != paginator.numpages %}
        <li class="page-item">
            <a class="page-link" href="{{ url|alink({}|merge(request)|slice(1,request|length)|merge({ 'page': currentPage + 1 })) }}">
                <svg class="icon">
                    <use xlink:href="#chevron-right" />
                </svg>
            </a>
        </li>
        {% endif %}
    </ul>
{# </div> #}
{% endif %}
