]> source.dussan.org Git - gitea.git/commitdiff
Explore page: Add topic param to pagination (#9077) (#9078)
authorDavid Svantesson <davidsvantesson@gmail.com>
Wed, 20 Nov 2019 09:07:09 +0000 (10:07 +0100)
committertechknowlogick <techknowlogick@gitea.io>
Wed, 20 Nov 2019 09:07:09 +0000 (04:07 -0500)
routers/home.go

index eddff28ee99658ee77c9e648c3a3d4d98f5407f2..50e1a2b2a4270deaeee25b9343c032c472e34bc8 100644 (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)