Add links to category in year category plot
This commit is contained in:
parent
309281f5e1
commit
8b9af8e1a4
3 changed files with 9 additions and 2 deletions
|
@ -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 %}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
{% endif %}
|
||||
{% if not category %}
|
||||
<h3>{% translate "Categories" %}</h3>
|
||||
{% category_plot transactions month=month %}
|
||||
{% category_plot transactions year=year %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue