Update pagination on montharchive to keep category

This commit is contained in:
Edgar P. Burkhart 2023-12-30 09:35:05 +01:00
parent 68ff2ae8ad
commit a0bc1a6608
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 14 additions and 3 deletions

View file

@ -9,8 +9,14 @@
{% endif %}
{% if month %}
<p class="pagination">
<a href="{% url "transaction_month" previous_month|date:"Y" previous_month|date:"m" %}">{{ previous_month|date:"F Y"|capfirst }}</a>
<a href="" class="cur">{{ month|date:"F Y"|capfirst }}</a>
<a href="{% url "transaction_month" next_month|date:"Y" next_month|date:"m" %}">{{ next_month|date:"F Y"|capfirst }}</a>
{% with month=previous_month %}
{% include "main/pagination_month.html" %}
{% endwith %}
{% with cur=True %}
{% include "main/pagination_month.html" %}
{% endwith %}
{% with month=next_month %}
{% include "main/pagination_month.html" %}
{% endwith %}
</p>
{% endif %}

View file

@ -0,0 +1,5 @@
{% load i18n %}
{% if month %}
<a {% if cur %}class="cur"{% endif %}
href="{% if category %}{% url "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>
{% endif %}