diff options
Diffstat (limited to 'templates/_pagination.html')
-rw-r--r-- | templates/_pagination.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/_pagination.html b/templates/_pagination.html new file mode 100644 index 0000000..cb0d13e --- /dev/null +++ b/templates/_pagination.html @@ -0,0 +1,19 @@ +{% macro render_pagination(pagination) %} + <div class=pagination> + {%- for page in pagination.iter_pages() %} + {% if page %} + {% if page != pagination.page %} + <a href="{{ url_for_other_page(page) }}">{{ page }}</a> + {% else %} + <strong>{{ page }}</strong> + {% endif %} + {% else %} + <span class=ellipsis>…</span> + {% endif %} + {%- endfor %} + {% if pagination.has_next %} + <a href="{{ url_for_other_page(pagination.page + 1) + }}">Next »</a> + {% endif %} + </div> +{% endmacro %} |