updated logging, added theming, added settings button
This commit is contained in:
parent
51b2ef43bc
commit
ca15fb7ec5
25 changed files with 384 additions and 62 deletions
|
@ -98,7 +98,7 @@ func PerformRedditSearch(query string, safe string, page int) ([]ForumSearchResu
|
|||
return results, nil
|
||||
}
|
||||
|
||||
func handleForumsSearch(w http.ResponseWriter, query, safe, lang string, page int) {
|
||||
func handleForumsSearch(w http.ResponseWriter, settings UserSettings, query, safe, lang string, page int) {
|
||||
results, err := PerformRedditSearch(query, safe, page)
|
||||
if err != nil || len(results) == 0 { // 0 == 0 to force search by other node
|
||||
log.Printf("No results from primary search, trying other nodes")
|
||||
|
@ -113,6 +113,7 @@ func handleForumsSearch(w http.ResponseWriter, query, safe, lang string, page in
|
|||
Page int
|
||||
HasPrevPage bool
|
||||
HasNextPage bool
|
||||
Theme string
|
||||
}{
|
||||
Query: query,
|
||||
Results: results,
|
||||
|
@ -121,6 +122,7 @@ func handleForumsSearch(w http.ResponseWriter, query, safe, lang string, page in
|
|||
Page: page,
|
||||
HasPrevPage: page > 1,
|
||||
HasNextPage: len(results) == 25,
|
||||
Theme: settings.Theme,
|
||||
}
|
||||
|
||||
funcMap := template.FuncMap{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue