{% macro selector(page_url, page, pages) -%} {# Show a page selector for a paginated view. page_url (Url): the URL instance referring to the page displaying the table. page (int): 0-based number of the current page. pages (int): total number of pages. #} {% if pages > 1 %}
{% endif %} {%- endmacro %} {% macro range_selector(page_url, page, pages, start, end) -%} {# Show a page range selector from start (included) to end (excluded). #} {% for i in range([0, start]|max, [pages, end]|min) %} {% if i != page %} {{ i + 1 }} {% else %} {{ i + 1 }} {% endif %} {% endfor %} {%- endmacro %}