diff --git a/files/templates/admin/dm_media.html b/files/templates/admin/dm_media.html index 7593f4ce4..90446f53c 100644 --- a/files/templates/admin/dm_media.html +++ b/files/templates/admin/dm_media.html @@ -59,5 +59,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/admin/image_posts.html b/files/templates/admin/image_posts.html index da0e32d14..000fad3ea 100644 --- a/files/templates/admin/image_posts.html +++ b/files/templates/admin/image_posts.html @@ -17,5 +17,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/admin/removed_posts.html b/files/templates/admin/removed_posts.html index 6f7e4cdbb..de0be4e1c 100644 --- a/files/templates/admin/removed_posts.html +++ b/files/templates/admin/removed_posts.html @@ -28,5 +28,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/admin/reported_posts.html b/files/templates/admin/reported_posts.html index e4fa6be99..bbcd4ecae 100644 --- a/files/templates/admin/reported_posts.html +++ b/files/templates/admin/reported_posts.html @@ -30,5 +30,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/admin/shadowbanned.html b/files/templates/admin/shadowbanned.html index 51af63366..6f2729187 100644 --- a/files/templates/admin/shadowbanned.html +++ b/files/templates/admin/shadowbanned.html @@ -37,5 +37,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/bank_statement.html b/files/templates/bank_statement.html index 48b87533c..a15ca8085 100644 --- a/files/templates/bank_statement.html +++ b/files/templates/bank_statement.html @@ -38,7 +38,7 @@ {% endfor %} - {% include "pagination.html" %} + {{macros.pagination("pb-0 pl-0 pt-1")}} diff --git a/files/templates/banned.html b/files/templates/banned.html index 06928481f..b058d41e2 100644 --- a/files/templates/banned.html +++ b/files/templates/banned.html @@ -37,5 +37,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/blocks.html b/files/templates/blocks.html index d9e0ff336..8dfa4d410 100644 --- a/files/templates/blocks.html +++ b/files/templates/blocks.html @@ -37,5 +37,5 @@ {% endblock %} {% block pagenav %} - {% include "pagination.html" %} + {{macros.pagination()}} {% endblock %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 0b09a3a3f..939f79c89 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,4 +1,3 @@ -{%- import 'util/macros.html' as macros with context -%} {% if not request.headers.get("xhr") %} {% if focused_comment %} diff --git a/files/templates/group_memberships.html b/files/templates/group_memberships.html index 277c178a7..dd4606dda 100644 --- a/files/templates/group_memberships.html +++ b/files/templates/group_memberships.html @@ -1,5 +1,4 @@ {% extends "default.html" %} -{%- import 'util/macros.html' as macros with context -%} {% block pagetitle %}!{{group}}{% endblock %} {% block content %}
+ {% if not size %} + {% set size = PAGE_SIZE %} + {% endif %} + {% set num_pages = (total / size) | round(0, 'ceil') | int %} + + {% set start_point = page - 2 %} + {% if start_point < 1 %} + {% set start_point = 1 %} + {% endif %} + + {% set end_point = start_point+4 %} + {% if end_point > num_pages %} + {% set start_point = start_point-(end_point-num_pages) %} + {% set end_point = num_pages %} + {% endif %} + + {% if start_point < 1 %} + {% set start_point = 1 %} + {% endif %} + + + {% if start_point > 1 %} +-
+ 1
+
+
+ {% if start_point == 3 %}
+ -
+ 2
+
+ {% elif start_point != 2 %}
+ -
+ ...
+
+ {% set start_point = start_point + 1 %}
+ {% endif %}
+ {% endif %}
+
+ {% for x in range(start_point, end_point+1) %}
+ -
+ {{x}}
+
+ {% endfor %}
+
+ {% if end_point < num_pages %}
+ {% if end_point == num_pages-2 %}
+ -
+ {{num_pages-1}}
+
+ {% elif end_point != num_pages-1 %}
+ -
+ ...
+
+ {% endif %}
+
+ -
+ {{num_pages}}
+
+ {% endif %}
+
+{% endmacro %}