Skip to content

Commit 72ea707

Browse files
committed
Added pagination into the template (it was already present in the view)
1 parent 43098f4 commit 72ea707

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

elevennote/note/templates/note/index.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
<p>No notes are available.</p>
1212
{% endif %}
1313

14-
<a href="{% url 'note:create' %}">Create a new note</a>
14+
{% if is_paginated %}
15+
<div class="pagination">
16+
<span class="step-links">
17+
{% if page_obj.has_previous %}
18+
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
19+
{% endif %}
20+
21+
<span class="current">
22+
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
23+
</span>
24+
25+
{% if page_obj.has_next %}
26+
<a href="?page={{ page_obj.next_page_number }}">next</a>
27+
{% endif %}
28+
</span>
29+
</div>
30+
{% endif %}
31+
32+
<div class="new-note">
33+
<a href="{% url 'note:create' %}">Create a new note</a>
34+
</div>
1535

1636
{% endblock %}

0 commit comments

Comments
 (0)