Start adding search for mobile
This commit is contained in:
parent
3dc03b1096
commit
4e76462794
|
@ -37,14 +37,23 @@ object Search extends LilaController {
|
|||
RateLimitGlobal("-", cost = cost) {
|
||||
Env.game.cached.nbTotal flatMap { nbGames =>
|
||||
implicit def req = ctx.body
|
||||
searchForm.bindFromRequest.fold(
|
||||
failure => Ok(html.search.index(failure, none, nbGames)).fuccess,
|
||||
data => data.nonEmptyQuery ?? { query =>
|
||||
env.paginator(query, page) map (_.some)
|
||||
} map { pager =>
|
||||
Ok(html.search.index(searchForm fill data, pager, nbGames))
|
||||
}
|
||||
)
|
||||
negotiate (
|
||||
html = searchForm.bindFromRequest.fold(
|
||||
failure => Ok(html.search.index(failure, none, nbGames)).fuccess,
|
||||
data => data.nonEmptyQuery ?? { query =>
|
||||
env.paginator(query, page) map (_.some)
|
||||
} map { pager =>
|
||||
Ok(html.search.index(searchForm fill data, pager, nbGames))
|
||||
}
|
||||
),
|
||||
api = _ => searchForm.bindFromRequest.fold(
|
||||
failure => Ok(html.search.index(failure, none, nbGames)).fuccess,
|
||||
data => data.nonEmptyQuery ?? { query =>
|
||||
env.paginator(query, page) map (_.some)
|
||||
} map { pager =>
|
||||
Ok(_)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue