diff --git a/nummi/history/templates/history/plot.html b/nummi/history/templates/history/plot.html
index 954c3ce..23a5035 100644
--- a/nummi/history/templates/history/plot.html
+++ b/nummi/history/templates/history/plot.html
@@ -1,5 +1,6 @@
{% load main_extras %}
{% load history_extras %}
+{% load transaction_extras %}
{% load i18n %}
diff --git a/nummi/history/templatetags/history_extras.py b/nummi/history/templatetags/history_extras.py
index 3991f8f..48a8aaf 100644
--- a/nummi/history/templatetags/history_extras.py
+++ b/nummi/history/templatetags/history_extras.py
@@ -1,13 +1,9 @@
import math
from django import template
-from django.template.defaultfilters import date
-from django.urls import reverse
from django.utils.safestring import mark_safe
from main.templatetags.main_extras import pmrvalue, remix
-from ..utils import ac_url
-
register = template.Library()
@@ -39,24 +35,6 @@ def up_down_icon(val):
return remix("arrow-down-s", "red")
-@register.simple_tag
-def month_url(month, **kwargs):
- url_name, url_params = ac_url(
- "transaction_month", {"year": month.year, "month": month.month}, **kwargs
- )
-
- url = reverse(url_name, kwargs=url_params)
- return mark_safe(f"""{ date(month, "Y-m") }""")
-
-
-@register.simple_tag
-def year_url(year, **kwargs):
- url_name, url_params = ac_url("transaction_year", {"year": year}, **kwargs)
-
- url = reverse(url_name, kwargs=url_params)
- return mark_safe(f"""{ year }""")
-
-
@register.simple_tag
def plot_bar(s, sum_pm, s_max):
_res = ""
diff --git a/nummi/history/utils.py b/nummi/history/utils.py
index 530a44f..320c10a 100644
--- a/nummi/history/utils.py
+++ b/nummi/history/utils.py
@@ -1,14 +1,9 @@
import datetime
-from django.db.models import Func, Max, Min, Q, Sum
+from django.db.models import Max, Min, Q, Sum
from django.db.models.functions import Abs, TruncMonth
-class GenerateMonth(Func):
- function = "generate_series"
- template = "%(function)s(%(expressions)s, '1 month')::date"
-
-
def history(transaction_set):
if not transaction_set.exists():
return None
@@ -50,14 +45,3 @@ def history(transaction_set):
"sum": _history.aggregate(max=Max(Abs("sum")))["max"],
},
}
-
-
-def ac_url(url_name, url_params, account=None, category=None):
- if account:
- url_name = "account_" + url_name
- url_params |= {"account": account.pk}
- elif category:
- url_name = "category_" + url_name
- url_params |= {"category": category.pk}
-
- return url_name, url_params
diff --git a/nummi/main/templates/main/list.html b/nummi/main/templates/main/list.html
index ee3050e..cd223b7 100644
--- a/nummi/main/templates/main/list.html
+++ b/nummi/main/templates/main/list.html
@@ -19,21 +19,23 @@
{% block h2 %}{% endblock %}
- {% if account %}
-
- {{ account.icon|remix }}{{ account }}
-
- {% endif %}
- {% if category %}
-
- {{ category.icon|remix }}{{ category }}
-
- {% endif %}
- {% if search %}
-
- {% translate "Search" %}
-
- {% endif %}
+ {% block backlinks %}
+ {% if account %}
+
+ {{ account.icon|remix }}{{ account }}
+
+ {% endif %}
+ {% if category %}
+
+ {{ category.icon|remix }}{{ category }}
+
+ {% endif %}
+ {% if search %}
+
+ {% translate "Search" %}
+
+ {% endif %}
+ {% endblock %}
{% include "main/pagination.html" %}
{% block table %}{% endblock %}
{% include "main/pagination.html" %}
diff --git a/nummi/main/templates/main/pagination.html b/nummi/main/templates/main/pagination.html
index 7f32ea2..54e9e12 100644
--- a/nummi/main/templates/main/pagination.html
+++ b/nummi/main/templates/main/pagination.html
@@ -1,4 +1,4 @@
-{% load i18n %}
+{% load i18n transaction_extras %}
{% if page_obj %}
{% endif %}
{% if month %}
+