Compare commits

...

2 commits

7 changed files with 20 additions and 9 deletions

View file

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

View file

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

View file

@ -23,7 +23,7 @@
<th scope="row" class="l"> <th scope="row" class="l">
{% if cat.category %} {% if cat.category %}
{% if month %} {% 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 %} {% else %}
{{ cat.category__name }} {{ cat.category__name }}
{% endif %} {% endif %}

View file

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

View file

@ -29,9 +29,9 @@
<th class="date" scope="row"> <th class="date" scope="row">
{% if date.has_transactions %} {% if date.has_transactions %}
{% if account %} {% 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 %} {% 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 %} {% else %}
<a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a> <a href="{% url "transaction_month" year=date.month.year month=date.month.month %}">{{ date.month|date:"Y-m" }}</a>
{% endif %} {% endif %}

View file

@ -9,8 +9,14 @@
{% endif %} {% endif %}
{% if month %} {% if month %}
<p class="pagination"> <p class="pagination">
<a href="{% url "transaction_month" previous_month|date:"Y" previous_month|date:"m" %}">{{ previous_month|date:"F Y"|capfirst }}</a> {% with month=previous_month %}
<a href="" class="cur">{{ month|date:"F Y"|capfirst }}</a> {% include "main/pagination_month.html" %}
<a href="{% url "transaction_month" next_month|date:"Y" next_month|date:"m" %}">{{ next_month|date:"F Y"|capfirst }}</a> {% endwith %}
{% with cur=True %}
{% include "main/pagination_month.html" %}
{% endwith %}
{% with month=next_month %}
{% include "main/pagination_month.html" %}
{% endwith %}
</p> </p>
{% endif %} {% endif %}

View file

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