From adc27750593aadb57f85f7b6817e4300f5ee180e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 16 Feb 2013 15:04:50 -0600 Subject: Paginator template cleanup --- templates/packages/search_paginator.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'templates/packages/search_paginator.html') diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 362b7cb3..758dca4c 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -1,12 +1,12 @@
{% if is_paginated %} -

{{paginator.count}} packages found. - Page {{page_obj.number}} of {{paginator.num_pages}}.

+

{{ paginator.count }} packages found. + Page {{ page_obj.number }} of {{ paginator.num_pages }}.

{% if page_obj.has_previous %} - < Prev {% else %} < Prev @@ -14,7 +14,7 @@ {% if page_obj.has_next %} - Next > {% else %} Next > -- cgit v1.2.3-54-g00ecf From 746023d529489b68f1a2494ff7572734b3b368ce Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 16 Feb 2013 15:38:29 -0600 Subject: Make page a query string parameter on package search This is a bit silly to encode in the URL, or at least makes it much harder to screen out via robots.txt and other such things. Signed-off-by: Dan McGee --- packages/urls.py | 1 - packages/views/display.py | 2 ++ templates/packages/search_paginator.html | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'templates/packages/search_paginator.html') diff --git a/packages/urls.py b/packages/urls.py index 9a151b4b..4e2e2638 100644 --- a/packages/urls.py +++ b/packages/urls.py @@ -24,7 +24,6 @@ (r'^update/$', 'update'), (r'^$', SearchListView.as_view(), {}, 'packages-search'), - (r'^(?P\d+)/$', SearchListView.as_view()), (r'^search/json/$', 'search_json'), (r'^differences/$', 'arch_differences', {}, 'packages-differences'), diff --git a/packages/views/display.py b/packages/views/display.py index 497c8d48..fcf8fdea 100644 --- a/packages/views/display.py +++ b/packages/views/display.py @@ -104,6 +104,8 @@ def redirect_agnostic(request, name, repo, arch): def redirect_to_search(request, name, repo, arch): + if request.GET.get('q'): + name = request.GET.get('q') pkg_data = [ ('arch', arch.lower()), ('repo', repo.lower()), diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 758dca4c..3c368b82 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -6,7 +6,7 @@
{% if page_obj.has_previous %} - < Prev {% else %} < Prev @@ -14,7 +14,7 @@ {% if page_obj.has_next %} - Next > {% else %} Next > -- cgit v1.2.3-54-g00ecf