diff options
Diffstat (limited to 'routers/repo/search.go')
-rw-r--r-- | routers/repo/search.go | 9 |
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) } |