From 64e2758e40b724524c9798dfe11a53c2074b0e67 Mon Sep 17 00:00:00 2001 From: mathieu Date: Fri, 29 Apr 2016 10:03:45 +0200 Subject: [PATCH] =?utf8?q?Fix=20url=20inexistant=20recherche=20avanc=C3=A9?= =?utf8?q?e=20Lien=20type=20r=C3=A9sultats=20avec=20page=3D1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- telemeta/templates/search/advanceSearch.html | 8 ++++---- telemeta/views/search.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/telemeta/templates/search/advanceSearch.html b/telemeta/templates/search/advanceSearch.html index 9e0ac8df..5ba73ce7 100644 --- a/telemeta/templates/search/advanceSearch.html +++ b/telemeta/templates/search/advanceSearch.html @@ -168,16 +168,16 @@
{% ifequal type 'item' %} -

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

+

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

{% else %} {% ifequal type 'corpus' %} -

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

+

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

{% else %} {% ifequal type 'fonds' %} -

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

+

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

{% else %} {% ifequal type 'collection'%} -

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

+

Items ({{item_count}}) | Collections ({{collection_count}}) | Corpus ({{corpus_count}}) | Fonds ({{fonds_count}})

{% endifequal %} {% endifequal %} {% endifequal %} diff --git a/telemeta/views/search.py b/telemeta/views/search.py index 37d21efd..4b6f18fd 100644 --- a/telemeta/views/search.py +++ b/telemeta/views/search.py @@ -26,6 +26,7 @@ import simplejson as json from django.http import HttpResponse from telemeta.forms.boolean_form import * from django.forms.formsets import formset_factory +import re class HaystackSearch(FacetedSearchView, SavedSearchView): @@ -124,6 +125,7 @@ class HaystackAdvanceSearch(SavedSearchView): self.results_per_page = int(request.GET.get('results_page')) else: self.results_per_page = 20 + self.requestURL = re.sub('&page=\d+', '&page=1', request.GET.urlencode()) return super(HaystackAdvanceSearch, self).__call__(request) def get_query(self): @@ -160,6 +162,7 @@ class HaystackAdvanceSearch(SavedSearchView): extra['results_page'] = self.results_per_page extra['booleanForm'] = formset_factory(BooleanSearch, extra=2) + extra['request_url'] = self.requestURL return extra def autocomplete(request): -- 2.39.5