From 14755df86bc2ac97e42082777d3386b6252a6704 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 30 Dec 2023 09:40:11 +0100 Subject: [PATCH] Fix pagination on month archive, keep account --- nummi/account/templates/account/account_form.html | 2 +- nummi/account/urls.py | 2 +- nummi/category/templates/category/category_plot.html | 2 +- nummi/category/urls.py | 2 +- nummi/history/templates/history/plot.html | 4 ++-- nummi/main/templates/main/pagination_month.html | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nummi/account/templates/account/account_form.html b/nummi/account/templates/account/account_form.html index 93918d4..7045203 100644 --- a/nummi/account/templates/account/account_form.html +++ b/nummi/account/templates/account/account_form.html @@ -14,7 +14,7 @@ {% include "statement/statement_table.html" %}

{% translate "Transactions" %}

{% include "transaction/transaction_table.html" %} - {% if history.data %} + {% if history %}

{% translate "History" %}

{% include "history/plot.html" %} {% endif %} diff --git a/nummi/account/urls.py b/nummi/account/urls.py index b46816f..e15f4d4 100644 --- a/nummi/account/urls.py +++ b/nummi/account/urls.py @@ -30,6 +30,6 @@ urlpatterns = [ path( "/history//", TransactionMonthView.as_view(), - name="transaction_month", + name="account_transaction_month", ), ] diff --git a/nummi/category/templates/category/category_plot.html b/nummi/category/templates/category/category_plot.html index 33d67fd..91d919e 100644 --- a/nummi/category/templates/category/category_plot.html +++ b/nummi/category/templates/category/category_plot.html @@ -23,7 +23,7 @@ {% if cat.category %} {% if month %} - {{ cat.category__name }} + {{ cat.category__name }} {% else %} {{ cat.category__name }} {% endif %} diff --git a/nummi/category/urls.py b/nummi/category/urls.py index 4809677..5bdc9c1 100644 --- a/nummi/category/urls.py +++ b/nummi/category/urls.py @@ -15,6 +15,6 @@ urlpatterns = [ path( "/history//", TransactionMonthView.as_view(), - name="transaction_month", + name="category_transaction_month", ), ] diff --git a/nummi/history/templates/history/plot.html b/nummi/history/templates/history/plot.html index 16e2b94..e8d7aa0 100644 --- a/nummi/history/templates/history/plot.html +++ b/nummi/history/templates/history/plot.html @@ -29,9 +29,9 @@ {% if date.has_transactions %} {% if account %} - {{ date.month|date:"Y-m" }} + {{ date.month|date:"Y-m" }} {% elif category %} - {{ date.month|date:"Y-m" }} + {{ date.month|date:"Y-m" }} {% else %} {{ date.month|date:"Y-m" }} {% endif %} diff --git a/nummi/main/templates/main/pagination_month.html b/nummi/main/templates/main/pagination_month.html index 019ecf8..207b354 100644 --- a/nummi/main/templates/main/pagination_month.html +++ b/nummi/main/templates/main/pagination_month.html @@ -1,5 +1,5 @@ {% load i18n %} {% if month %} {{ month|date:"F Y"|capfirst }} + href="{% if account %}{% url "account_transaction_month" account.id month|date:"Y" month|date:"m" %}{% elif category %}{% url "category_transaction_month" category.id month|date:"Y" month|date:"m" %}{% else %}{% url "transaction_month" month|date:"Y" month|date:"m" %}{% endif %}">{{ month|date:"F Y"|capfirst }} {% endif %}