on master help sign in
Add a variable with all the icons of the theme

Add for the template a list of available icons in the current theme.

commit0bfc793194f44cc3c0e6fdeb9dc9c00c448c0324 authorCqoicebordel <Cqoicebordel@users.noreply.github.com> dateFri 12 Dec 2014, 19:09 (12 years ago) parent41aca9a
1 file changed+7−1
searx/webapp.py+7−1
searx/webapp.py+7−1
@@ -291,6 +291,11 @@ def index():
291291 for engine in result['engines']:
292292 if engine in favicons:
293293 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)
294299
295300 # TODO, check if timezone is calculated right
296301 if 'publishedDate' in result:
@@ -344,7 +349,8 @@ def index():
344349 suggestions=search.suggestions,
345350 answers=search.answers,
346351 infoboxes=search.infoboxes,
347− theme=get_current_theme_name()
352+ theme=get_current_theme_name(),
353+ favicons=favs
348354 )
349355
350356