Commit 30c0dc94 authored by Michal Čihař's avatar Michal Čihař

Use standard pager on search results

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent f94d0dc0
......@@ -9,20 +9,12 @@
{% block content %}
<span class="navi-toolbar ui-widget-header ui-corner-all">
<span id="navi">
<a id="button-first" {% if units.number == 1 %}class="button-disabled"{% endif %} href="?page=1&amp;{{ query_string }}">{% trans "First" %}</a>
<a id="button-prev" {% if not units.has_previous %}class="button-disabled"{% else %}href="?page={{ units.previous_page_number }}&amp;{{ query_string }}"{% endif %}>{% trans "Previous" %}</a>
<a id="button-pos" class="textbutton">{% blocktrans with units.number as position and units.paginator.num_pages as total %}{{ position }} / {{ total }}{% endblocktrans %}</a>
<a id="button-next" {% if not units.has_next %}class="button-disabled"{% else %}href="?page={{ units.next_page_number }}&amp;{{ query_string }}"{% endif %}>{% trans "Next" %}</a>
<a id="button-end" {% if units.paginator.num_pages == units.number %}class="button-disabled"{% endif %} href="?page={{ units.paginator.num_pages }}&amp;{{ query_string }}">{% trans "Last" %}</a>
</span>
</span>
{% include "paginator.html" %}
{% if units.object_list %}
{% if page_obj.object_list %}
<table>
<tbody>
{% for unit in units.object_list %}
{% for unit in page_obj.object_list %}
<tr><th colspan="2">
<a href="{{ unit.translation.get_absolute_url }}">{{ unit.translation }}</a>
{{ unit.get_state_flags }}
......
......@@ -140,7 +140,7 @@ def search(request):
# results.
units = paginator.page(paginator.num_pages)
context['units'] = units
context['page_obj'] = units
context['title'] = _('Search for %s') % (
search_form.cleaned_data['q']
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment