diff --git a/passbook/admin/templates/administration/application/list.html b/passbook/admin/templates/administration/application/list.html index dca760042..3ee400409 100644 --- a/passbook/admin/templates/administration/application/list.html +++ b/passbook/admin/templates/administration/application/list.html @@ -62,7 +62,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/certificatekeypair/list.html b/passbook/admin/templates/administration/certificatekeypair/list.html index d009495dc..782ecbc95 100644 --- a/passbook/admin/templates/administration/certificatekeypair/list.html +++ b/passbook/admin/templates/administration/certificatekeypair/list.html @@ -64,7 +64,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/flow/list.html b/passbook/admin/templates/administration/flow/list.html index 9d8891a1d..1f6ca4ae4 100644 --- a/passbook/admin/templates/administration/flow/list.html +++ b/passbook/admin/templates/administration/flow/list.html @@ -69,7 +69,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/group/list.html b/passbook/admin/templates/administration/group/list.html index 44a498c74..69c046863 100644 --- a/passbook/admin/templates/administration/group/list.html +++ b/passbook/admin/templates/administration/group/list.html @@ -61,7 +61,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/outpost/list.html b/passbook/admin/templates/administration/outpost/list.html index 35034c710..4392687db 100644 --- a/passbook/admin/templates/administration/outpost/list.html +++ b/passbook/admin/templates/administration/outpost/list.html @@ -83,7 +83,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/policy/list.html b/passbook/admin/templates/administration/policy/list.html index 98fc3f4cf..552c1a543 100644 --- a/passbook/admin/templates/administration/policy/list.html +++ b/passbook/admin/templates/administration/policy/list.html @@ -78,7 +78,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/policy_binding/list.html b/passbook/admin/templates/administration/policy_binding/list.html index 6b133599a..0e852e6bf 100644 --- a/passbook/admin/templates/administration/policy_binding/list.html +++ b/passbook/admin/templates/administration/policy_binding/list.html @@ -75,7 +75,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/property_mapping/list.html b/passbook/admin/templates/administration/property_mapping/list.html index 0e3ea5314..2684d813d 100644 --- a/passbook/admin/templates/administration/property_mapping/list.html +++ b/passbook/admin/templates/administration/property_mapping/list.html @@ -72,7 +72,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/provider/list.html b/passbook/admin/templates/administration/provider/list.html index 95cc490e4..9bb347b69 100644 --- a/passbook/admin/templates/administration/provider/list.html +++ b/passbook/admin/templates/administration/provider/list.html @@ -91,7 +91,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/source/list.html b/passbook/admin/templates/administration/source/list.html index 7ce88965a..c88e29d31 100644 --- a/passbook/admin/templates/administration/source/list.html +++ b/passbook/admin/templates/administration/source/list.html @@ -85,7 +85,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/stage/list.html b/passbook/admin/templates/administration/stage/list.html index 8f92ebdcc..a5420899a 100644 --- a/passbook/admin/templates/administration/stage/list.html +++ b/passbook/admin/templates/administration/stage/list.html @@ -81,7 +81,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/stage_binding/list.html b/passbook/admin/templates/administration/stage_binding/list.html index da1e0db3d..2f2c058e0 100644 --- a/passbook/admin/templates/administration/stage_binding/list.html +++ b/passbook/admin/templates/administration/stage_binding/list.html @@ -81,7 +81,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/stage_invitation/list.html b/passbook/admin/templates/administration/stage_invitation/list.html index e341cae82..fc5bb541d 100644 --- a/passbook/admin/templates/administration/stage_invitation/list.html +++ b/passbook/admin/templates/administration/stage_invitation/list.html @@ -54,7 +54,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/stage_prompt/list.html b/passbook/admin/templates/administration/stage_prompt/list.html index 7b9503944..8855b4ee3 100644 --- a/passbook/admin/templates/administration/stage_prompt/list.html +++ b/passbook/admin/templates/administration/stage_prompt/list.html @@ -80,7 +80,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/token/list.html b/passbook/admin/templates/administration/token/list.html index c73489774..52eaf9687 100644 --- a/passbook/admin/templates/administration/token/list.html +++ b/passbook/admin/templates/administration/token/list.html @@ -65,7 +65,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/admin/templates/administration/user/list.html b/passbook/admin/templates/administration/user/list.html index 78a6e9dc0..aa9f81678 100644 --- a/passbook/admin/templates/administration/user/list.html +++ b/passbook/admin/templates/administration/user/list.html @@ -61,7 +61,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
{% else %} diff --git a/passbook/audit/templates/audit/list.html b/passbook/audit/templates/audit/list.html index b42c93cd3..214ab744e 100644 --- a/passbook/audit/templates/audit/list.html +++ b/passbook/audit/templates/audit/list.html @@ -77,7 +77,7 @@ {% endfor %} -
+
{% include 'partials/pagination.html' %}
diff --git a/passbook/core/templates/partials/pagination.html b/passbook/core/templates/partials/pagination.html index c026e558c..fa4568f7f 100644 --- a/passbook/core/templates/partials/pagination.html +++ b/passbook/core/templates/partials/pagination.html @@ -1,43 +1,42 @@ {% load i18n %} +{% load passbook_utils %} -
-
-
- {{ page_obj.start_index }} - {{ page_obj.end_index }}of - {{ page_obj.count }} -
- {% with param=get_param|default:'page' %} - - {% endwith %} + +
diff --git a/passbook/lib/templatetags/passbook_utils.py b/passbook/lib/templatetags/passbook_utils.py index 7a59262cf..3cda3388a 100644 --- a/passbook/lib/templatetags/passbook_utils.py +++ b/passbook/lib/templatetags/passbook_utils.py @@ -4,6 +4,7 @@ from urllib.parse import urlencode from django import template from django.db.models import Model +from django.http.request import HttpRequest from django.template import Context from django.utils.html import escape, mark_safe from structlog import get_logger @@ -115,3 +116,15 @@ def debug(obj) -> str: def doc(obj) -> str: """Return docstring of object""" return mark_safe(obj.__doc__.replace("\n", "
")) + + +@register.simple_tag(takes_context=True) +def query_transform(context: Context, **kwargs) -> str: + """Append objects to the current querystring""" + if "request" not in context: + return "" + request: HttpRequest = context["request"] + updated = request.GET.copy() + for key, value in kwargs.items(): + updated[key] = value + return updated.urlencode()