From adb6f7e9e73716e58529d96540f204e5e0825179 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sun, 25 Feb 2024 22:35:49 -0600 Subject: Add pagination macro --- templates/comments/index.jinja | 3 +++ templates/macros/pagination.jinja | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 templates/macros/pagination.jinja diff --git a/templates/comments/index.jinja b/templates/comments/index.jinja index 4f082bd..217ddb3 100644 --- a/templates/comments/index.jinja +++ b/templates/comments/index.jinja @@ -1,3 +1,5 @@ +{% import 'macros/pagination.jinja' as pagination %} +
{% for comment in page.items %}
@@ -26,4 +28,5 @@
{% endfor %} + {{ pagination.render_pagination(page, 'comments.index') }}
diff --git a/templates/macros/pagination.jinja b/templates/macros/pagination.jinja new file mode 100644 index 0000000..fdd8993 --- /dev/null +++ b/templates/macros/pagination.jinja @@ -0,0 +1,18 @@ +{% macro render_pagination(pagination, endpoint) %} +
+ {{ pagination.first }} - {{ pagination.last }} of {{ pagination.total }} +
+ +{% endmacro %} \ No newline at end of file -- cgit v1.2.3