Skip to content

Commit 93febb6

Browse files
committed
show group pagination
1 parent 52df50a commit 93febb6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

templates/classrooms/group_list.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ <h2 class="text-5xl mb-10 text-center">My Groups</h2>
1515
</div>
1616
{% endif %}
1717

18+
19+
1820
{% for group in group_list %}
1921
<div class="mb-10">
2022
<h2>{{ group }}</h2>
@@ -52,6 +54,30 @@ <h2>{{ group }}</h2>
5254
</div>
5355
</div>
5456
{% endfor %}
57+
58+
59+
{% if page_obj.paginator.num_pages > 1 %}
60+
<div class="pagination mt-8">
61+
<span class="step-links">
62+
{% if page_obj.has_previous %}
63+
<a class="text-primary" href="?page=1">&laquo; first</a> |
64+
<a class="text-primary" href="?page={{ page_obj.previous_page_number }}">previous</a> |
65+
{% endif %}
66+
67+
<span class="current">
68+
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
69+
</span>
70+
71+
{% if page_obj.has_next %}
72+
|
73+
<a href="?page={{ page_obj.next_page_number }}" class="text-primary">next</a> |
74+
<a href="?page={{ page_obj.paginator.num_pages }}" class="text-primary">last &raquo;</a>
75+
{% endif %}
76+
</span>
77+
</div>
78+
{% endif %}
79+
80+
5581
</div>
5682

5783
</div>

0 commit comments

Comments
 (0)