Add pagination to year archive view
This commit is contained in:
parent
8b9af8e1a4
commit
60f84fe20d
3 changed files with 19 additions and 1 deletions
|
@ -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 %}
|
||||||
|
|
|
@ -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 %}
|
||||||
|
|
5
nummi/main/templates/main/pagination_year.html
Normal file
5
nummi/main/templates/main/pagination_year.html
Normal 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 %}
|
Loading…
Reference in a new issue