From fcbac38d6fd8c91be0da5e7f37e7bc69b071253a Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sat, 20 Apr 2019 06:15:19 +0200 Subject: Unifies pagination template usage (#6531) (#6533) --- routers/repo/search.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'routers/repo/search.go') 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) } -- cgit v1.2.3