19 lines
405 B
Go
Raw Normal View History

package search
import (
"github.com/aerogo/aero"
2017-06-20 22:54:45 +02:00
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
2017-06-20 23:27:14 +02:00
const maxUsers = 9 * 7
const maxAnime = 9 * 7
2017-06-20 22:54:45 +02:00
2017-06-17 01:25:02 +02:00
// Get search page.
func Get(ctx *aero.Context) string {
2017-06-20 23:58:20 +02:00
term := ctx.Get("term")
2017-06-20 22:54:45 +02:00
2017-06-20 23:58:20 +02:00
userResults, animeResults := arn.Search(term, maxUsers, maxAnime)
return ctx.HTML(components.SearchResults(userResults, animeResults))
}