Commit 82d0b069 authored by fred's avatar fred

search: include facets in previous & next links

parent 545644ec
......@@ -136,6 +136,8 @@ class SearchView(FacetedSearchView):
def extra_context(self):
context = super(SearchView, self).extra_context()
context['sectionName'] = 'Search'
if self.request.GET.getlist('selected_facets'):
context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
context['selected_categories'] = [
x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
if x.startswith('categories_exact')]
......@@ -181,6 +183,8 @@ class ListenArchivesView(FacetedSearchView):
def extra_context(self):
context = super(ListenArchivesView, self).extra_context()
context['sectionName'] = "Listen"
if self.request.GET.getlist('selected_facets'):
context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
context['selected_format'] = [
x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
if x.startswith('format_exact')]
......@@ -220,6 +224,8 @@ class NewsArchivesView(FacetedSearchView):
def extra_context(self):
context = super(NewsArchivesView, self).extra_context()
if self.request.GET.getlist('selected_facets'):
context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
context['sectionName'] = 'News'
context['selected_news_categories'] = [
x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
......
......@@ -64,7 +64,7 @@
{% if page.has_previous %}
<div class="previous-page cf">
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}">&laquo; Résultats précédénts</a>
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}{{ facets_qs }}">&laquo; Résultats précédénts</a>
</div>
{% endif %}
......@@ -76,7 +76,7 @@
{% if page.has_next %}
<div class="next-page cf">
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}{{ facets_qs }}">Résultats suivants &raquo;</a>
</div>
{% endif %}
......
......@@ -65,7 +65,7 @@
{% if page.has_previous %}
<div class="previous-page cf">
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}">&laquo; Résultats précédénts</a>
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}{{ facets_qs }}">&laquo; Résultats précédénts</a>
</div>
{% endif %}
......@@ -91,7 +91,7 @@
{% if page.has_next %}
<div class="next-page cf">
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}{{ facets_qs }}">Résultats suivants &raquo;</a>
</div>
{% endif %}
......
......@@ -70,7 +70,7 @@
{% endif %}
{% if page.has_previous %}
<div class="previous-page cf">
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}">&laquo; Résultats précédénts</a>
<a class="button big left" href="?q={{ query }}&amp;page={{ page.previous_page_number }}{{ facets_qs }}">&laquo; Résultats précédénts</a>
</div>
{% endif %}
......@@ -89,7 +89,7 @@
</ul>
{% if page.has_next %}
<div class="next-page cf">
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}{{ facets_qs }}">Résultats suivants &raquo;</a>
</div>
{% endif %}
</div>
......
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