Browse Source

Fix #1302

pull/1313/head
Eduardo Calil 9 years ago
parent
commit
b2ffc9d4eb
  1. 19
      sapl/base/views.py
  2. 8
      sapl/templates/search/search.html

19
sapl/base/views.py

@ -460,7 +460,18 @@ class AppConfigCrud(CrudAux):
class SearchView(SearchView):
results_per_page = 1
def get_results(self):
x = super(SearchView, self).get_results()
import ipdb; ipdb.set_trace()
return x
def get_context(self):
context = super(SearchView, self).get_context()
if 'models' in self.request.GET:
models = self.request.GET.getlist('models')
else:
models = []
context['models'] = ''
for m in models:
context['models'] = context['models'] + '&models=' + m
return context

8
sapl/templates/search/search.html

@ -93,9 +93,13 @@
{% if page.has_previous or page.has_next %}
<div>
{% if page.has_previous %}<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}">{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
{% if page.has_previous %}
<a href="?q={{ query }}&amp;page={{ page.previous_page_number }}{{ models }}">
{% endif %}&laquo; Previous{% if page.has_previous %}</a>{% endif %}
|
{% if page.has_next %}<a href="?q={{ query }}&amp;page={{ page.next_page_number }}">{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
{% if page.has_next %}
<a href="?q={{ query }}&amp;page={{ page.next_page_number }}{{ models }}">
{% endif %}Next &raquo;{% if page.has_next %}</a>{% endif %}
</div>
{% endif %}
{% else %}

Loading…
Cancel
Save