SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 30df8890 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Include pagination in Topic list

parent 349b328b
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
<li><a href="{% url 'ontology:topic_details' slug=topic.slug %}">{{ topic }}</a></li> <li><a href="{% url 'ontology:topic_details' slug=topic.slug %}">{{ topic }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% if is_paginated %}
<div class="col-12">
{% include 'partials/pagination.html' with page_obj=page_obj %}
</div>
{% endif %}
</div> </div>
</div> </div>
......
...@@ -12,7 +12,7 @@ from django.views.generic.list import ListView ...@@ -12,7 +12,7 @@ from django.views.generic.list import ListView
from .models import Topic, RelationAsym, RelationSym from .models import Topic, RelationAsym, RelationSym
from scipost.mixins import PermissionsMixin from scipost.mixins import PaginationMixin, PermissionsMixin
def ontology(request): def ontology(request):
...@@ -41,8 +41,9 @@ class TopicUpdateView(PermissionsMixin, UpdateView): ...@@ -41,8 +41,9 @@ class TopicUpdateView(PermissionsMixin, UpdateView):
success_url = reverse_lazy('ontology:topics') success_url = reverse_lazy('ontology:topics')
class TopicListView(ListView): class TopicListView(PaginationMixin, ListView):
model = Topic model = Topic
paginate_by = 25
class TopicDetailView(DetailView): class TopicDetailView(DetailView):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment