|
|
@ -23,7 +23,7 @@ |
|
|
|
<tbody> |
|
|
|
{% for doc in object_list %} |
|
|
|
<tr> |
|
|
|
<td>{{ forloop.counter }}</td> |
|
|
|
<td>{{ forloop.counter0|add:page_obj.start_index }}</td> |
|
|
|
<td>{{ doc.text|truncatechars:200 }}</td> |
|
|
|
</tr> |
|
|
|
{% endfor %} |
|
|
@ -33,19 +33,47 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
{% if is_paginated %} |
|
|
|
<nav class="pagination is-right" role="navigation" aria-label="pagination"> |
|
|
|
<nav class="pagination is-left" role="navigation" aria-label="pagination"> |
|
|
|
<ul class="pagination-list"> |
|
|
|
{% if page_obj.number == 1 %} |
|
|
|
<li class="pagination-link" disabled><span>⇤</span></li> |
|
|
|
{% else %} |
|
|
|
<li> |
|
|
|
<a class="pagination-link" href="?page=1">⇤</a> |
|
|
|
</li> |
|
|
|
{% endif %} |
|
|
|
{% if page_obj.has_previous %} |
|
|
|
<li> |
|
|
|
<a class="pagination-link" href="?page={{ page_obj.previous_page_number }}">«</a> |
|
|
|
</li> |
|
|
|
{% else %} |
|
|
|
<li class="pagination-link" disabled><span>«</span></li> |
|
|
|
{% endif %} |
|
|
|
{% for i in paginator.page_range %} |
|
|
|
{% if page_obj.number == i %} |
|
|
|
<li> |
|
|
|
<a class="pagination-link is-current" aria-label="Goto page {{ i }}">{{ i }}</a> |
|
|
|
</li> |
|
|
|
{% else %} |
|
|
|
{% elif i > page_obj.number|add:'-5' and i < page_obj.number|add:'5' %} |
|
|
|
<li> |
|
|
|
<a href="?page={{ i }}" class="pagination-link" aria-label="Goto page {{ i }}">{{ i }}</a> |
|
|
|
</li> |
|
|
|
{% endif %} |
|
|
|
{% endfor %} |
|
|
|
{% if page_obj.has_next %} |
|
|
|
<li> |
|
|
|
<a class="pagination-link" href="?page={{ page_obj.next_page_number }}">»</a> |
|
|
|
</li> |
|
|
|
{% else %} |
|
|
|
<li class="pagination-link" disabled><span>»</span></li> |
|
|
|
{% endif %} |
|
|
|
{% if page_obj.number == paginator.num_pages %} |
|
|
|
<li class="pagination-link" disabled><span>⇥</span></li> |
|
|
|
{% else %} |
|
|
|
<li> |
|
|
|
<a class="pagination-link" href="?page={{ paginator.num_pages }}">⇥</a> |
|
|
|
</li> |
|
|
|
{% endif %} |
|
|
|
</ul> |
|
|
|
</nav> |
|
|
|
{% endif %} |