aboutsummaryrefslogtreecommitdiff
path: root/templates/macros/paging.html
diff options
context:
space:
mode:
authorJoris2021-01-03 13:40:40 +0100
committerJoris2021-01-03 13:54:20 +0100
commit11052951b74b9ad4b6a9412ae490086235f9154b (patch)
tree64526ac926c1bf470ea113f6cac8a33158684e8d /templates/macros/paging.html
parent371449b0e312a03162b78797b83dee9d81706669 (diff)
downloadbudget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.gz
budget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.bz2
budget-11052951b74b9ad4b6a9412ae490086235f9154b.zip
Rewrite in Rust
Diffstat (limited to 'templates/macros/paging.html')
-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 %}