search fixes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 19 Mar 2012 12:58:57 +0000 (13:58 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 19 Mar 2012 12:58:57 +0000 (13:58 +0100)
apps/catalogue/urls.py
wolnelektury/static/js/widget.js
wolnelektury/static/opensearch.xml
wolnelektury/templates/superbase.html
wolnelektury/urls.py

index 88e6226..c40c4ec 100644 (file)
@@ -4,8 +4,6 @@
 #
 from django.conf.urls.defaults import *
 from catalogue.feeds import AudiobookFeed
-from catalogue.models import Book
-from picture.models import Picture
 from catalogue.views import CustomPDFFormView
 
 
@@ -25,7 +23,7 @@ urlpatterns = patterns('picture.views',
     url(r'^daisy/$', 'daisy_list', name='daisy_list'),
     url(r'^tags/$', 'tags_starting_with', name='hint'),
     url(r'^jtags/$', 'json_tags_starting_with', name='jhint'),
-    url(r'^szukaj/$', 'search', name='old_search'),
+    #url(r'^szukaj/$', 'search', name='old_search'),
 
     # zip
     url(r'^zip/pdf\.zip$', 'download_zip', {'format': 'pdf', 'slug': None}, 'download_zip_pdf'),
@@ -48,4 +46,10 @@ urlpatterns = patterns('picture.views',
     url(r'^custompdf$', CustomPDFFormView(), name='custom_pdf_form'),
     url(r'^custompdf/(?P<slug>%s).pdf' % SLUG, 'download_custom_pdf'),
 
-) 
+)
+
+urlpatterns += patterns('django.views.generic.simple',
+    # old static pages - redirected
+    url(r'^szukaj/$', 'redirect_to',
+        {'url': '/szukaj/'}),
+)
index d8e1fec..de30eb7 100644 (file)
@@ -17,7 +17,7 @@ stylesheet.setAttribute('rel', 'stylesheet');
 stylesheet.setAttribute('href', 'http://'+host+'/static/css/widget.css');
 linkLogo.setAttribute('href', 'http://'+host);
 logo.setAttribute('src', 'http://'+host+'/static/img/logo.png');
-form.setAttribute('action', 'http://'+host+'/fullsearch/');
+form.setAttribute('action', 'http://'+host+'/szukaj/');
 form.setAttribute('method', 'get');
 form.setAttribute('accept-charset', 'utf-8');
 form.setAttribute('id', 'wl-form');
index cf904d0..1e05889 100644 (file)
@@ -8,12 +8,12 @@
     <Developer>Fundacja Nowoczesna Polska</Developer>
     <Language>pl</Language>
     <Contact>fundacja@nowoczesnapolska.org.pl</Contact>
-    <Image height="16" width="16" type="image/x-icon">http://www.wolnelektury.pl/static/img/favicon.ico</Image>
-    <Image height="64" width="64" type="image/png">http://www.wolnelektury.pl/static/img/wl_icon_64.png</Image>
+    <Image height="16" width="16" type="image/x-icon">http://static.wolnelektury.pl/static/img/favicon.ico</Image>
+    <Image height="64" width="64" type="image/png">http://static.wolnelektury.pl/static/img/wl_icon_64.png</Image>
     <Url type="application/atom+xml;profile=opds-catalog"
-        template="http://www.wolnelektury.pl/opds/search/?q={searchTerms}&amp;author={atom:author}&amp;translator={atom:contributor}&amp;title={atom:title}" />
-    <Url type="text/html" method="GET" template="http://www.wolnelektury.pl/katalog/szukaj?q={searchTerms}" />
+        template="http://wolnelektury.pl/opds/search/?q={searchTerms}&amp;author={atom:author}&amp;translator={atom:contributor}&amp;title={atom:title}" />
+    <Url type="text/html" method="GET" template="http://wolnelektury.pl/szukaj?q={searchTerms}" />
     <Url type="application/x-suggestions+json" method="GET" template="http://www.wolnelektury.pl/katalog/jtags?mozhint=1&amp;q={searchTerms}" />
-    <moz:SearchForm>http://www.wolnelektury.pl/katalog/</moz:SearchForm>
+    <moz:SearchForm>http://wolnelektury.pl/</moz:SearchForm>
     <Query role="example" searchTerms="sÅ‚owa" />
 </OpenSearchDescription>
index 1cb43b0..138bffe 100644 (file)
@@ -96,7 +96,7 @@
 
 
 
-            <form id="search-area" action="/fullsearch/" class="hidelabels">
+            <form id="search-area" action="{% url search %}" class="hidelabels">
                 
                 <div id="search-field" class="grid-line">
                        <label for="search">{{search_form.q.label}}</label>
index 3806b73..d027036 100644 (file)
@@ -44,7 +44,7 @@ urlpatterns += patterns('',
     # API
     (r'^api/', include('api.urls')),
 
-    url(r'^fullsearch/', include('search.urls')),
+    url(r'^szukaj/', include('search.urls')),
 
     # Static files
     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',