summaryrefslogtreecommitdiffstats
path: root/routers/home.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-11-20 10:07:09 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-11-20 04:07:09 -0500
commit35c3ea952a6eb558e69de55fc94d301676feb935 (patch)
tree1f122491b995bdca993777623b5e19befe8737ff /routers/home.go
parenta85d916d3ebf5a6dcdc616f7e98926a952a7b144 (diff)
downloadgitea-35c3ea952a6eb558e69de55fc94d301676feb935.tar.gz
gitea-35c3ea952a6eb558e69de55fc94d301676feb935.zip
Explore page: Add topic param to pagination (#9077) (#9078)
Diffstat (limited to 'routers/home.go')
-rw-r--r--routers/home.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/home.go b/routers/home.go
index eddff28ee9..50e1a2b2a4 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -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)