Skip to content

Commit

Permalink
Explore page: Add topic param to pagination (#9077) (#9078)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsvantesson authored and techknowlogick committed Nov 20, 2019
1 parent a85d916 commit 35c3ea9
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 35c3ea9

Please sign in to comment.