Skip to content

Commit

Permalink
Explore page: Add topic param to pagination (go-gitea#9077)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsvantesson committed Nov 19, 2019
1 parent af7f08b commit dc8774e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions routers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit dc8774e

Please sign in to comment.