fix language/safe search gui

This commit is contained in:
partisan 2024-08-13 16:38:02 +02:00
parent 8fece91f75
commit 6b3373f7d6
13 changed files with 748 additions and 694 deletions

14
main.go
View file

@ -92,9 +92,21 @@ func handleSearch(w http.ResponseWriter, r *http.Request) {
}
// Render the search page template if no query
data := struct {
LanguageOptions []LanguageOption
CurrentLang string
Theme string
Safe string
}{
LanguageOptions: languageOptions,
CurrentLang: settings.Language,
Theme: settings.Theme,
Safe: settings.SafeSearch,
}
if query == "" {
tmpl := template.Must(template.ParseFiles("templates/search.html"))
tmpl.Execute(w, settings)
tmpl.Execute(w, data)
return
}