diff --git a/nummi/main/templates/main/pagination.html b/nummi/main/templates/main/pagination.html index a97e1d2..27da9da 100644 --- a/nummi/main/templates/main/pagination.html +++ b/nummi/main/templates/main/pagination.html @@ -2,26 +2,3 @@ {% if page_obj %}

{% pagination_links page_obj %}

{% endif %} -{% if month %} -

{% year_url month %}

-

- {% if previous_month %} - {% month_url previous_month fmt="F Y" %} - {% endif %} - {% month_url month cls="cur" fmt="F Y" %} - {% if next_month %} - {% month_url next_month fmt="F Y" %} - {% endif %} -

-{% endif %} -{% if year %} -

- {% if previous_year %} - {% year_url previous_year cls="prev" %} - {% endif %} - {% year_url year cls="cur" %} - {% if next_year %} - {% year_url next_year cls="next" %} - {% endif %} -

-{% endif %} diff --git a/nummi/transaction/templates/transaction/transaction_archive_month.html b/nummi/transaction/templates/transaction/transaction_archive_month.html index 58937ec..1a78cb8 100644 --- a/nummi/transaction/templates/transaction/transaction_archive_month.html +++ b/nummi/transaction/templates/transaction/transaction_archive_month.html @@ -1,20 +1,37 @@ -{% extends "transaction/transaction_list.html" %} -{% load i18n main_extras transaction_extras static category %} +{% extends "main/base.html" %} +{% load i18n static main_extras transaction_extras category %} {% block link %} {{ block.super }} {% css "main/css/plot.css" %} -{% endblock %} -{% block name %}{{ month|date:"F Y"|capfirst }}{% endblock %} -{% block h2 %}{{ month|date:"F Y"|capfirst }}{% endblock %} -{% block backlinks %} - {{ block.super }} + {% css "main/css/table.css" %} +{% endblock link %} +{% block title %} + {{ year|date:"Y" }} – {{ block.super }} +{% endblock title %} +{% block body %} +

{{ month|date:"F Y"|capfirst }}

+

{% year_url month %}

+

+ {% if previous_month %} + {% month_url previous_month fmt="F Y" %} + {% endif %} + {% month_url month cls="cur" fmt="F Y" %} + {% if next_month %} + {% month_url next_month fmt="F Y" %} + {% endif %} +

{% if account or category %}

- {% translate "Back" %}{{ "arrow-go-back"|remix }} + {{ "arrow-go-back"|remix }}{% translate "Back" %} + {% if account %} + {{ account.icon|remix }}{{ account }} + {% endif %} + {% if category %} + {{ category.icon|remix }}{{ category }} + {% endif %}

{% endif %} -{% endblock %} -{% block table %} {% if not category %}

{% translate "Categories" %}

@@ -23,6 +40,20 @@ {% endif %}

{% translate "Transactions" %}

- {{ block.super }} + {% url_get "transactions" start_date=month end_date=month|end_of_month category=category.id account=account.id as t_url %} +

+ {{ "list-check"|remixnl }}{% translate "View all transactions" %} +

+ {% transaction_table transactions n_max=8 transactions_url=t_url %}
-{% endblock %} +

{% year_url month %}

+

+ {% if previous_month %} + {% month_url previous_month fmt="F Y" %} + {% endif %} + {% month_url month cls="cur" fmt="F Y" %} + {% if next_month %} + {% month_url next_month fmt="F Y" %} + {% endif %} +

+{% endblock body %} diff --git a/nummi/transaction/templates/transaction/transaction_archive_year.html b/nummi/transaction/templates/transaction/transaction_archive_year.html index d6a28c4..f872e73 100644 --- a/nummi/transaction/templates/transaction/transaction_archive_year.html +++ b/nummi/transaction/templates/transaction/transaction_archive_year.html @@ -1,20 +1,35 @@ -{% extends "transaction/transaction_list.html" %} -{% load i18n main_extras static category %} +{% extends "main/base.html" %} +{% load i18n static main_extras transaction_extras category %} {% block link %} {{ block.super }} {% css "main/css/plot.css" %} -{% endblock %} -{% block name %}{{ year|date:"Y" }}{% endblock %} -{% block h2 %}{{ year|date:"Y" }}{% endblock %} -{% block backlinks %} - {{ block.super }} + {% css "main/css/table.css" %} +{% endblock link %} +{% block title %} + {{ year|date:"Y" }} – {{ block.super }} +{% endblock title %} +{% block body %} +

{{ year|date:"Y" }}

+

+ {% if previous_year %} + {% year_url previous_year cls="prev" %} + {% endif %} + {% year_url year cls="cur" %} + {% if next_year %} + {% year_url next_year cls="next" %} + {% endif %} +

{% if account or category %}

- {% translate "Back" %}{{ "arrow-go-back"|remix }} + {{ "arrow-go-back"|remix }}{% translate "Back" %} + {% if account %} + {{ account.icon|remix }}{{ account }} + {% endif %} + {% if category %} + {{ category.icon|remix }}{{ category }} + {% endif %}

{% endif %} -{% endblock %} -{% block table %} {% if history %}

{% translate "History" %}

@@ -29,6 +44,19 @@ {% endif %}

{% translate "Transactions" %}

- {{ block.super }} + {% url_get "transactions" start_date=year end_date=year|end_of_year category=category.id account=account.id as t_url %} +

+ {{ "list-check"|remixnl }}{% translate "View all transactions" %} +

+ {% transaction_table transactions n_max=8 transactions_url=t_url %}
-{% endblock %} +

+ {% if previous_year %} + {% year_url previous_year cls="prev" %} + {% endif %} + {% year_url year cls="cur" %} + {% if next_year %} + {% year_url next_year cls="next" %} + {% endif %} +

+{% endblock body %} diff --git a/nummi/transaction/views.py b/nummi/transaction/views.py index b196449..447ea0f 100644 --- a/nummi/transaction/views.py +++ b/nummi/transaction/views.py @@ -251,5 +251,6 @@ class TransactionYearView(UserMixin, TransactionACMixin, YearArchiveView): h_data = context_data.get("transactions") if not (context_data.get("account") or context_data.get("category")): h_data = h_data.exclude(category__budget=False) + context_data["history"] = history(h_data) - return context_data | {"history": history(h_data)} + return context_data