mirror of
1
Fork 0

Explore page: Add topic param to pagination (#9077) (#9078)

This commit is contained in:
David Svantesson 2019-11-20 10:07:09 +01:00 committed by techknowlogick
parent a85d916d3e
commit 35c3ea952a
1 changed files with 2 additions and 0 deletions

View File

@ -132,6 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
keyword := strings.Trim(ctx.Query("q"), " ")
topicOnly := ctx.QueryBool("topic")
ctx.Data["TopicOnly"] = topicOnly
repos, count, err = models.SearchRepository(&models.SearchRepoOptions{
Page: page,
@ -155,6 +156,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
pager := context.NewPagination(int(count), opts.PageSize, page, 5)
pager.SetDefaultParams(ctx)
pager.AddParam(ctx, "topic", "TopicOnly")
ctx.Data["Page"] = pager
ctx.HTML(200, opts.TplName)