Add a variable with all the icons of the theme
Add for the template a list of available icons in the current theme.
This commit is contained in:
		
							parent
							
								
									41aca9a068
								
							
						
					
					
						commit
						0bfc793194
					
				@ -292,6 +292,11 @@ def index():
 | 
				
			|||||||
            if engine in favicons:
 | 
					            if engine in favicons:
 | 
				
			||||||
                result['favicon'] = engine
 | 
					                result['favicon'] = engine
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
 | 
					        mypath = searx_dir+"/static/"+get_current_theme_name()+"/img/"
 | 
				
			||||||
 | 
					        favs=[]
 | 
				
			||||||
 | 
					        for (dirpath, dirnames, filenames) in os.walk(mypath):
 | 
				
			||||||
 | 
					            favs.extend(filenames)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO, check if timezone is calculated right
 | 
					        # TODO, check if timezone is calculated right
 | 
				
			||||||
        if 'publishedDate' in result:
 | 
					        if 'publishedDate' in result:
 | 
				
			||||||
            result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
 | 
					            result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
 | 
				
			||||||
@ -344,7 +349,8 @@ def index():
 | 
				
			|||||||
        suggestions=search.suggestions,
 | 
					        suggestions=search.suggestions,
 | 
				
			||||||
        answers=search.answers,
 | 
					        answers=search.answers,
 | 
				
			||||||
        infoboxes=search.infoboxes,
 | 
					        infoboxes=search.infoboxes,
 | 
				
			||||||
        theme=get_current_theme_name()
 | 
					        theme=get_current_theme_name(),
 | 
				
			||||||
 | 
					        favicons=favs
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user