Selaa lähdekoodia

Add a variable with all the icons of the theme

Add for the template a list of available icons in the current theme.
Cqoicebordel 10 vuotta sitten
vanhempi
commit
0bfc793194
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7
    1
      searx/webapp.py

+ 7
- 1
searx/webapp.py Näytä tiedosto

291
         for engine in result['engines']:
291
         for engine in result['engines']:
292
             if engine in favicons:
292
             if engine in favicons:
293
                 result['favicon'] = engine
293
                 result['favicon'] = engine
294
+                
295
+        mypath = searx_dir+"/static/"+get_current_theme_name()+"/img/"
296
+        favs=[]
297
+        for (dirpath, dirnames, filenames) in os.walk(mypath):
298
+            favs.extend(filenames)
294
 
299
 
295
         # TODO, check if timezone is calculated right
300
         # TODO, check if timezone is calculated right
296
         if 'publishedDate' in result:
301
         if 'publishedDate' in result:
344
         suggestions=search.suggestions,
349
         suggestions=search.suggestions,
345
         answers=search.answers,
350
         answers=search.answers,
346
         infoboxes=search.infoboxes,
351
         infoboxes=search.infoboxes,
347
-        theme=get_current_theme_name()
352
+        theme=get_current_theme_name(),
353
+        favicons=favs
348
     )
354
     )
349
 
355
 
350
 
356