aboutsummaryrefslogtreecommitdiff
path: root/templates/macros
diff options
context:
space:
mode:
Diffstat (limited to 'templates/macros')
-rw-r--r--templates/macros/paging.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/templates/macros/paging.html b/templates/macros/paging.html
new file mode 100644
index 0000000..59ba617
--- /dev/null
+++ b/templates/macros/paging.html
@@ -0,0 +1,55 @@
+{% macro paging(url, page, max_page) %}
+ {% if url is containing("?") %}
+ {% set sign = "&" %}
+ {% else %}
+ {% set sign = "?" %}
+ {% endif %}
+
+ <div class="g-Paging">
+ {% if page > 1 %}
+ <a
+ class="g-Paging__Link g-Paging__Link--Active"
+ href="{{ url }}"
+ >
+ ❬❬
+ </a>
+ <a
+ class="g-Paging__Link g-Paging__Link--Active"
+ href="{{ url }}{{ sign }}page={{ page - 1 }}"
+ >
+ ❬
+ </a>
+ {% else %}
+ <span class="g-Paging__Link">
+ ❬❬
+ </span>
+ <span class="g-Paging__Link">
+ ❬
+ </span>
+ {% endif %}
+
+ {{ page }} / {{ max_page }}
+
+ {% if page < max_page %}
+ <a
+ class="g-Paging__Link g-Paging__Link--Active"
+ href="{{ url }}{{ sign }}page={{ page + 1 }}"
+ >
+ ❭
+ </a>
+ <a
+ class="g-Paging__Link g-Paging__Link--Active"
+ href="{{ url }}{{ sign }}page={{ max_page }}"
+ >
+ ❭❭
+ </a>
+ {% else %}
+ <span class="g-Paging__Link">
+ ❭
+ </span>
+ <span class="g-Paging__Link">
+ ❭❭
+ </span>
+ {% endif %}
+ </div>
+{% endmacro paging %}