Add links to category in year category plot

This commit is contained in:
Edgar P. Burkhart 2024-01-02 11:59:44 +01:00
parent 309281f5e1
commit 8b9af8e1a4
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
3 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,8 @@
{% if cat.category %}
{% if month %}
<a href="{% url "category_transaction_month" cat.category month.year month.month %}">{{ cat.category__name }}</a>
{% elif year %}
<a href="{% url "category_transaction_year" cat.category year.year %}">{{ cat.category__name }}</a>
{% else %}
{{ cat.category__name }}
{% endif %}

View File

@ -1,5 +1,5 @@
from django.urls import path
from transaction.views import TransactionMonthView
from transaction.views import TransactionMonthView, TransactionYearView
from . import views
@ -12,6 +12,11 @@ urlpatterns = [
name="category_transactions",
),
path("<category>/delete", views.CategoryDeleteView.as_view(), name="del_category"),
path(
"<category>/history/<int:year>",
TransactionYearView.as_view(),
name="category_transaction_year",
),
path(
"<category>/history/<int:year>/<int:month>",
TransactionMonthView.as_view(),

View File

@ -17,6 +17,6 @@
{% endif %}
{% if not category %}
<h3>{% translate "Categories" %}</h3>
{% category_plot transactions month=month %}
{% category_plot transactions year=year %}
{% endif %}
{% endblock %}