view src/ltpdarepo/templates/pagination.html @ 230:5c5f6d93d9d4

Add hg revision id to version string for dev builds.
author Daniele Nicolodi <daniele@grinta.net>
date Wed, 30 Nov 2011 09:41:29 +0100
parents 2c1253e826cc
children
line wrap: on
line source

{% macro render(pagination) %}
<div class="pagination wrapper">
  <div class="count">
  {% if pagination.count > pagination.size %}
     <span>{{ pagination.size }} of {{ pagination.count }} objects</span>
      <a href="{{ url_for_other_size(pagination.size * 2) }}">show more</a>
      {% if pagination.size > 16 %}
      <a href="{{ url_for_other_size(pagination.size // 2) }}">less</a>
      {% endif %}
  {% else %}
     <span>{{ pagination.count }} objects</span>
     {% if pagination.size > 16 %}
     <a href="{{ url_for_other_size(pagination.size // 2) }}">show less</a>
     {% endif %}
  {% endif %}
  </div>
  <div class="pages">
  {% if pagination.has_prev %}
    <a class="prev" href="{{ url_for_other_page(pagination.current - 1) }}" alt="prev">&laquo;</a>
  {% else %}
    <span class="prev discrete">&laquo;</span>
  {% endif %}
  {% for page in pagination %}
    {% if page > 0 %}
      {% if page != pagination.current %}
        <a href="{{ url_for_other_page(page) }}">{{ page }}</a>
      {% else %}
        <span class="current">{{ page }}</span>
      {% endif %}
    {% else %}
      <span class="ellipsis">&hellip;</span>
    {% endif %}
  {% endfor %}
  {% if pagination.has_next %}
    <a class="next" href="{{ url_for_other_page(pagination.current + 1) }}" alt="next">&raquo;</a>
  {% else %}
    <span class="next discrete">&raquo;</span>
  {% endif %}
  </div>
</div>
{% endmacro %}