fix pagination
This commit is contained in:
parent
fcfbc77143
commit
cedc3fec64
|
@ -47,7 +47,7 @@
|
|||
<div class="small-4 small-offset-4 columns">
|
||||
<ul class="pagination">
|
||||
{% if results.has_previous %}
|
||||
<li><a href="?page={{ results.previous_page_number }}">«</a></li>
|
||||
<li><a href="?q={{ query }}&page={{ results.previous_page_number }}">«</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><span>«</span></li>
|
||||
{% endif %}
|
||||
|
@ -55,11 +55,11 @@
|
|||
{% if results.number == i %}
|
||||
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
|
||||
{% else %}
|
||||
<li><a href="?page={{ i }}">{{ i }}</a></li>
|
||||
<li><a href="?q={{ query }}&page={{ i }}">{{ i }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if results.has_next %}
|
||||
<li><a href="?page={{ results.next_page_number }}">»</a></li>
|
||||
<li><a href="?q={{ query }}&page={{ results.next_page_number }}">»</a></li>
|
||||
{% else %}
|
||||
<li class="disabled"><span>»</span></li>
|
||||
{% endif %}
|
||||
|
|
|
@ -108,7 +108,7 @@ def texts(request, shortname=None):
|
|||
return render(request, 'texts.html', {
|
||||
'texts': texts,
|
||||
'latest_content_list': latest_content_list,
|
||||
'gallery':gallery
|
||||
'gallery': gallery
|
||||
})
|
||||
|
||||
|
||||
|
@ -131,7 +131,10 @@ def search(request):
|
|||
except EmptyPage:
|
||||
results = paginator.page(paginator.num_pages)
|
||||
|
||||
return render(request, 'results.html', {'results': results})
|
||||
return render(request, 'results.html', {
|
||||
'results': results,
|
||||
'query': q
|
||||
})
|
||||
|
||||
|
||||
class GalleryListViews(ListView):
|
||||
|
|
Loading…
Reference in New Issue
Block a user