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,6 +291,11 @@ def index():
291 291
         for engine in result['engines']:
292 292
             if engine in favicons:
293 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 300
         # TODO, check if timezone is calculated right
296 301
         if 'publishedDate' in result:
@@ -344,7 +349,8 @@ def index():
344 349
         suggestions=search.suggestions,
345 350
         answers=search.answers,
346 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