summaryrefslogtreecommitdiffstats
path: root/routers/repo/search.go
diff options
context:
space:
mode:
authorMario Lubenka <mario.lubenka@googlemail.com>2019-04-20 06:15:19 +0200
committertechknowlogick <matti@mdranta.net>2019-04-20 00:15:19 -0400
commitfcbac38d6fd8c91be0da5e7f37e7bc69b071253a (patch)
treecdf7c901df75d0d2f26567d1090ed0e3c1af138d /routers/repo/search.go
parent40dc458bb69f9827e804e2fe51c9f42caf3d3ddc (diff)
downloadgitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.tar.gz
gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.zip
Unifies pagination template usage (#6531) (#6533)
Diffstat (limited to 'routers/repo/search.go')
-rw-r--r--routers/repo/search.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/repo/search.go b/routers/repo/search.go
index 95715c30c6..de16eda83d 100644
--- a/routers/repo/search.go
+++ b/routers/repo/search.go
@@ -12,8 +12,6 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/search"
"code.gitea.io/gitea/modules/setting"
-
- "github.com/Unknwon/paginater"
)
const tplSearch base.TplName = "repo/search"
@@ -36,12 +34,15 @@ func Search(ctx *context.Context) {
return
}
ctx.Data["Keyword"] = keyword
- pager := paginater.New(total, setting.UI.RepoSearchPagingNum, page, 5)
- ctx.Data["Page"] = pager
ctx.Data["SourcePath"] = setting.AppSubURL + "/" +
path.Join(ctx.Repo.Repository.Owner.Name, ctx.Repo.Repository.Name, "src", "branch", ctx.Repo.Repository.DefaultBranch)
ctx.Data["SearchResults"] = searchResults
ctx.Data["RequireHighlightJS"] = true
ctx.Data["PageIsViewCode"] = true
+
+ pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
+ pager.SetDefaultParams(ctx)
+ ctx.Data["Page"] = pager
+
ctx.HTML(200, tplSearch)
}