Changed the pagination template variable to pagination_links.

This commit is contained in:
依瑪貓 2020-07-07 22:50:57 +08:00
parent e9509c9bac
commit 92867c3e97
2 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,7 @@ class BaseReportView(generic.ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
data = super(BaseReportView, self).get_context_data(**kwargs) data = super(BaseReportView, self).get_context_data(**kwargs)
data["pagination"] = self.pagination data["pagination_links"] = self.pagination.links
return data return data

View File

@ -21,9 +21,9 @@ First written: 2020/7/1
{% endcomment %} {% endcomment %}
{# The pagination, if any #} {# The pagination, if any #}
{% if pagination.is_paged %} {% if pagination_links %}
<ul class="pagination"> <ul class="pagination">
{% for link in pagination.links %} {% for link in pagination_links %}
{% if link.url is not None %} {% if link.url is not None %}
<li class="page-item {% if link.is_active %} active {% endif %}{% if not link.is_small_screen %} d-none d-md-inline {% endif %}"> <li class="page-item {% if link.is_active %} active {% endif %}{% if not link.is_small_screen %} d-none d-md-inline {% endif %}">
<a class="page-link" href="{{ link.url }}">{{ link.title }}</a> <a class="page-link" href="{{ link.url }}">{{ link.title }}</a>