{% load bob %}

<div class="pagination pagination-centered">
    {% if page.has_other_pages %}
    <ul>
        {% if page.has_previous %}
        <li><a href="?{{ url_previous_page }}"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-blue-document-page-previous"
            {% else %}
            class="icon-arrow-left"
            {% endif %}
            ></i></a></li>
        {% else %}
        <li class="disable"><a href="#"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-document-page-previous"
            {% else %}
            class="icon-arrow-left"
            {% endif %}
            ></i></a></li>
        {% endif %}
        {% for p, url in url_pages %}
        {%  if p == '...' %}
        <li class="disabled"><a href="#">&hellip;</a></li>
        {%  else %}
        <li
        {%   if p == page.number %}
        class="active"
        {%   endif %}
        ><a href="?{{ url }}">{{ p }}</a></li>
        {%  endif %}
        {% endfor %}
        {% if page.has_next %}
        <li><a href="?{{ url_next_page }}"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-blue-document-page-next"
            {% else %}
            class="icon-arrow-right"
            {% endif %}
            ></i></a></li>
        {% else %}
        <li class="disabled" ><a href="#"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-document-page-next"
            {% else %}
            class="icon-arrow-right"
            {% endif %}
            ></i></a></li>
        {% endif %}
    </ul>
    {% endif %}
    <ul>
        {% if show_all and page %}
        <li><a href="?{{ url_all }}" rel="tooltip"
               title="Show all items on a single page"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-blue-documents-stack"
            {% else %}
            class="icon-list-alt"
            {% endif %}
            ></i> {{ page.paginator.count }} items</a></li>
        {% endif %}
        {% if show_csv %}
        <li><a href="?{% bob_export_url url_query 'csv' export_variable_name %}" rel="tooltip"
               title="Export as CSV"><i
            {% if fugue_icons %}
            class="fugue-icon fugue-blue-document-excel-csv"
            {% else %}
            class="icon-download"
            {% endif %}
            ></i> CSV</a></li>
        {% endif %}
    </ul></div>