{% comment %}
 coding: utf-8

 maposmatic, the web front-end of the MapOSMatic city map generation system
 Copyright (C) 2012  David Decotigny
 Copyright (C) 2012  Frédéric Lehobey
 Copyright (C) 2012  Pierre Mauduit
 Copyright (C) 2012  David Mentré
 Copyright (C) 2012  Maxime Petazzoni
 Copyright (C) 2012  Thomas Petazzoni
 Copyright (C) 2012  Gaël Utard

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as
 published by the Free Software Foundation, either version 3 of the
 License, or any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU Affero General Public License for more details.

 You should have received a copy of the GNU Affero General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}

{% load i18n %}
{% load extratags %}

{% ifnotequal data.paginator.num_pages 1 %}
<div class="pagination pull-right">
  <ul>
    <li class="{% if not data.has_previous %}disabled{% endif %}">
      <a href="?{% if is_search %}query={{ query|urlencode }}&{% endif %}page={{ data.previous_page_number }}">&laquo;</a>
    </li>
    {% for num in pages %}<li class="{% ifequal num data.number %}active{% endifequal %} {% ifequal num "..." %}disabled{% endifequal %}">
      {% ifequal num "..." %}<a>{{ num }}</a>{% else %}<a href="?{% if is_search %}query={{ query|urlencode }}&{% endif %}page={{ num }}">{{ num }}</a>{% endifequal %}
    </li>{% endfor %}
    <li class="{% if not data.has_next %}disabled{% endif %}">
      <a href="?{% if is_search %}query={{ query|urlencode }}&{% endif %}page={{ data.next_page_number }}">&raquo;</a>
    </li>
  </ul>
</div>
{% endifnotequal %}
