{% 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
 Copyright (C) 2018  Hartmut Holzgraefe

 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 l10n %}
{% load extratags %}

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