From 830575406be07409ef1fe6132f7dbd2927a424aa Mon Sep 17 00:00:00 2001 From: Faheedkhan Date: Sun, 15 Jun 2025 19:55:40 +0300 Subject: [PATCH] chnaged the pagination logic --- templates/admin_management/auth_logs.html | 15 ++- templates/admin_management/model_logs.html | 7 +- templates/admin_management/request_logs.html | 7 +- templates/partials/pagination.html | 109 ++++++++++++++----- templates/partials/pagination_audit.html | 31 ------ 5 files changed, 99 insertions(+), 70 deletions(-) delete mode 100644 templates/partials/pagination_audit.html diff --git a/templates/admin_management/auth_logs.html b/templates/admin_management/auth_logs.html index 26a2643c..8a153232 100644 --- a/templates/admin_management/auth_logs.html +++ b/templates/admin_management/auth_logs.html @@ -49,14 +49,13 @@ -
-
- {% if is_paginated %} - {% include 'partials/pagination.html' %} - {% endif %} -
-
- {% include 'partials/pagination_audit.html' with q='loginEvents' %} + + +
+
+ {% include 'partials/pagination.html' with q='loginEvents' %} +
+
{% else %}

No authentication audit events found.

diff --git a/templates/admin_management/model_logs.html b/templates/admin_management/model_logs.html index 3362cb52..545665b2 100644 --- a/templates/admin_management/model_logs.html +++ b/templates/admin_management/model_logs.html @@ -110,7 +110,12 @@ -{% include 'partials/pagination_audit.html' with q='userActions' %} + +
+
+ {% include 'partials/pagination.html' with q='userActions' %} +
+
{% else %}

{% trans "No model change audit events found." %}

diff --git a/templates/admin_management/request_logs.html b/templates/admin_management/request_logs.html index 1168c676..8dd913aa 100644 --- a/templates/admin_management/request_logs.html +++ b/templates/admin_management/request_logs.html @@ -48,7 +48,12 @@ - {% include 'partials/pagination_audit.html' with q='userRequests' %} + +
+
+ {% include 'partials/pagination.html' with q='userRequests' %} +
+
{% else %}

No request audit events found.

{% endif %} diff --git a/templates/partials/pagination.html b/templates/partials/pagination.html index 67cebdf1..4562a370 100644 --- a/templates/partials/pagination.html +++ b/templates/partials/pagination.html @@ -1,39 +1,90 @@ {% load i18n static %} -
-
+
-
\ No newline at end of file + + {# Last Page Link #} + {% if page_obj.has_next %} +
  • + + + {% trans 'Last' %} + +
  • + {% else %} +
  • + + + {% trans 'Last' %} + +
  • + {% endif %} + + diff --git a/templates/partials/pagination_audit.html b/templates/partials/pagination_audit.html deleted file mode 100644 index f8e192bf..00000000 --- a/templates/partials/pagination_audit.html +++ /dev/null @@ -1,31 +0,0 @@ -{% load i18n static %} - -
    -
    - {# Previous Button #} - {% if page_obj.has_previous %} - - - {% trans "Previous" %} - - {% else %} - - - {% trans "Previous" %} - - {% endif %} - - - {# Next Button #} - {% if page_obj.has_next %} - - {% trans "Next" %} - - - {% else %} - - {% trans "Next" %} - - - {% endif %} -
    \ No newline at end of file