Browse Source

[fix] opensearch autocomplete

Adam Tauber 11 years ago
parent
commit
879bac8adb
2 changed files with 3 additions and 6 deletions
  1. 2
    2
      searx/templates/opensearch.xml
  2. 1
    4
      searx/webapp.py

+ 2
- 2
searx/templates/opensearch.xml View File

6
   <LongName>searx metasearch</LongName>
6
   <LongName>searx metasearch</LongName>
7
   {% if method == 'get' %}
7
   {% if method == 'get' %}
8
     <Url type="text/html" method="get" template="{{ host }}?q={searchTerms}"/>
8
     <Url type="text/html" method="get" template="{{ host }}?q={searchTerms}"/>
9
-    {% if client.autocompleter %}
9
+    {% if autocomplete %}
10
     <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
10
     <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
11
         <Param name="format" value="x-suggestions" />
11
         <Param name="format" value="x-suggestions" />
12
         <Param name="q" value="{searchTerms}" />
12
         <Param name="q" value="{searchTerms}" />
16
     <Url type="text/html" method="post" template="{{ host }}">
16
     <Url type="text/html" method="post" template="{{ host }}">
17
         <Param name="q" value="{searchTerms}" />
17
         <Param name="q" value="{searchTerms}" />
18
     </Url>
18
     </Url>
19
-    {% if client.autocompleter %}
19
+    {% if autocomplete %}
20
     <!-- TODO, POST REQUEST doesn't work -->
20
     <!-- TODO, POST REQUEST doesn't work -->
21
     <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
21
     <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
22
         <Param name="format" value="x-suggestions" />
22
         <Param name="format" value="x-suggestions" />

+ 1
- 4
searx/webapp.py View File

350
 
350
 
351
         return resp
351
         return resp
352
     return render('preferences.html',
352
     return render('preferences.html',
353
-                  client=settings.get('client', None),
354
                   locales=settings['locales'],
353
                   locales=settings['locales'],
355
                   current_locale=get_locale(),
354
                   current_locale=get_locale(),
356
                   current_language=lang or 'all',
355
                   current_language=lang or 'all',
369
     return render(
368
     return render(
370
         'stats.html',
369
         'stats.html',
371
         stats=stats,
370
         stats=stats,
372
-        client=settings.get('client', None)
373
     )
371
     )
374
 
372
 
375
 
373
 
392
 
390
 
393
     ret = render('opensearch.xml',
391
     ret = render('opensearch.xml',
394
                  method=method,
392
                  method=method,
395
-                 host=get_base_url(),
396
-                 client=settings['client'])
393
+                 host=get_base_url())
397
 
394
 
398
     resp = Response(response=ret,
395
     resp = Response(response=ret,
399
                     status=200,
396
                     status=200,