Fix pagination on month archive, keep account

This commit is contained in:
Edgar P. Burkhart 2023-12-30 09:40:11 +01:00
parent a0bc1a6608
commit 14755df86b
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
6 changed files with 7 additions and 7 deletions

View File

@ -14,7 +14,7 @@
{% include "statement/statement_table.html" %}
<h3>{% translate "Transactions" %}</h3>
{% include "transaction/transaction_table.html" %}
{% if history.data %}
{% if history %}
<h3>{% translate "History" %}</h3>
{% include "history/plot.html" %}
{% endif %}

View File

@ -30,6 +30,6 @@ urlpatterns = [
path(
"<account>/history/<int:year>/<int:month>",
TransactionMonthView.as_view(),
name="transaction_month",
name="account_transaction_month",
),
]

View File

@ -23,7 +23,7 @@
<th scope="row" class="l">
{% if cat.category %}
{% if month %}
<a href="{% url "transaction_month" cat.category month.year month.month %}">{{ cat.category__name }}</a>
<a href="{% url "category_transaction_month" cat.category month.year month.month %}">{{ cat.category__name }}</a>
{% else %}
{{ cat.category__name }}
{% endif %}

View File

@ -15,6 +15,6 @@ urlpatterns = [
path(
"<category>/history/<int:year>/<int:month>",
TransactionMonthView.as_view(),
name="transaction_month",
name="category_transaction_month",
),
]

View File

@ -29,9 +29,9 @@
<th class="date" scope="row">
{% if date.has_transactions %}
{% if account %}
<a href="{% url "transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
<a href="{% url "account_transaction_month" account=account.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% elif category %}
<a href="{% url "transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
<a href="{% url "category_transaction_month" category=category.pk year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% else %}
<a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% endif %}

View File

@ -1,5 +1,5 @@
{% load i18n %}
{% if month %}
<a {% if cur %}class="cur"{% endif %}
href="{% if category %}{% url "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 }}</a>
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 }}</a>
{% endif %}