{% load i18n%}

<ul class="pager pull-left">
  <li class="page">
    {% blocktrans with page=page.number pages=paginator.num_pages %}
    Page {{ page }} of {{ pages }}
    {% endblocktrans %}
  </li>
  {% if page.has_previous %}
    <li>
      <a href="{% url root_link %}{{ querystring }}" class="tooltip-top" title="{% trans "Go to first page" %}">
        {% trans "First" %}
      </a>
    </li>
    {% if page.number > 2 %}
    <li>
      <a href="{% url root_link page=page.previous_page_number %}{{ querystring }}" class="tooltip-top" title="{% trans "Go to previous page" %}">
        <span class="glyphicon glyphicon-chevron-left"></span>
      </a>
    </li>
    {% endif %}
  {% endif %}
  {% if page.has_next %}
    {% if page.next_page_number < paginator.num_pages %}
    <li>
      <a href="{% url root_link page=page.next_page_number %}{{ querystring }}" class="tooltip-top" title="{% trans "Go to next page" %}">
        <span class="glyphicon glyphicon-chevron-right"></span>
      </a>
    </li>
    {% endif %}
    <li>
      <a href="{% url root_link page=paginator.num_pages %}{{ querystring }}" class="tooltip-top" title="{% trans "Go to last page" %}">
        {% trans "Last" %}
      </a>
    </li>
  {% endif %}
</ul>
