From 8b0c0d245c1e003c8aa7a78d67a94ebb8465bf4a Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 18 Apr 2023 16:03:12 +0200 Subject: [PATCH] Update pagination --- nummi/main/static/main/css/main.css | 10 ++++++++++ nummi/main/templates/main/list/pagination.html | 9 +++++++++ nummi/main/templates/main/list/snapshot.html | 17 ++--------------- nummi/main/templates/main/list/transaction.html | 17 ++--------------- 4 files changed, 23 insertions(+), 30 deletions(-) create mode 100644 nummi/main/templates/main/list/pagination.html diff --git a/nummi/main/static/main/css/main.css b/nummi/main/static/main/css/main.css index 46901b0..f3cc370 100644 --- a/nummi/main/static/main/css/main.css +++ b/nummi/main/static/main/css/main.css @@ -115,3 +115,13 @@ nav > :first-child, main > :first-child { margin-top: 0; } + +#pagination { + text-align: center; + font-feature-settings: var(--num); +} +#pagination a {width: 2rem} +#pagination a.cur { + font-weight: 650; + text-decoration: underline dotted; +} diff --git a/nummi/main/templates/main/list/pagination.html b/nummi/main/templates/main/list/pagination.html new file mode 100644 index 0000000..5fdef1b --- /dev/null +++ b/nummi/main/templates/main/list/pagination.html @@ -0,0 +1,9 @@ +{% load i18n %} +{% if page_obj %} +

+ {% for page in paginator.page_range %} + {{ page }} + {% endfor %} +

+{% endif %} diff --git a/nummi/main/templates/main/list/snapshot.html b/nummi/main/templates/main/list/snapshot.html index ddca8d1..28c385a 100644 --- a/nummi/main/templates/main/list/snapshot.html +++ b/nummi/main/templates/main/list/snapshot.html @@ -20,22 +20,9 @@

{% translate "Statements" %}

{% if object %}{{ object }}{% endif %} {% if snapshots %} + {% include "main/list/pagination.html" %} {% include "main/table/snapshot.html" %} - {% if page_obj %} - - {% endif %} + {% include "main/list/pagination.html" %} {% else %}

{% translate "No snapshots to show" %}

{% endif %} diff --git a/nummi/main/templates/main/list/transaction.html b/nummi/main/templates/main/list/transaction.html index 3a55852..d2c6672 100644 --- a/nummi/main/templates/main/list/transaction.html +++ b/nummi/main/templates/main/list/transaction.html @@ -26,22 +26,9 @@ {% translate "Search" %} {% endif %} {% if transactions %} + {% include "main/list/pagination.html" %} {% include "main/table/transaction.html" %} - {% if page_obj %} - - {% endif %} + {% include "main/list/pagination.html" %} {% else %}

{% translate "No transactions to show" %}

{% endif %}