mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
committed by
techknowlogick
parent
40dc458bb6
commit
fcbac38d6f
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user