Add pagination to year archive view

This commit is contained in:
Edgar P. Burkhart 2024-01-02 12:06:20 +01:00
parent 8b9af8e1a4
commit 60f84fe20d
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 19 additions and 1 deletions

View file

@ -20,3 +20,16 @@
{% endwith %} {% endwith %}
</p> </p>
{% endif %} {% endif %}
{% if year %}
<p class="pagination">
{% with year=previous_year %}
{% include "main/pagination_year.html" %}
{% endwith %}
{% with cur=True %}
{% include "main/pagination_year.html" %}
{% endwith %}
{% with year=next_year %}
{% include "main/pagination_year.html" %}
{% endwith %}
</p>
{% endif %}

View file

@ -1,5 +1,5 @@
{% load i18n %} {% load i18n %}
{% if month %} {% if month %}
<a {% if cur %}class="cur"{% endif %} <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> href="{% if account %}{% url "account_transaction_month" account.id month.year month.month %}{% elif category %}{% url "category_transaction_month" category.id month.year month.month %}{% else %}{% url "transaction_month" month.year month.month %}{% endif %}">{{ month|date:"F Y"|capfirst }}</a>
{% endif %} {% endif %}

View file

@ -0,0 +1,5 @@
{% load i18n %}
{% if year %}
<a {% if cur %}class="cur"{% endif %}
href="{% if account %}{% url "account_transaction_year" account.id year.year %}{% elif category %}{% url "category_transaction_year" category.id year.year %}{% else %}{% url "transaction_year" year.year %}{% endif %}">{{ year|date:"Y" }}</a>
{% endif %}