1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 06:57:20 +00:00

Fix git graph page (#34948)

fix #34946
This commit is contained in:
wxiaoguang
2025-07-04 23:41:19 +08:00
committed by GitHub
parent 41678e1a57
commit 70685a9489
10 changed files with 90 additions and 210 deletions

View File

@ -166,10 +166,13 @@ func Graph(ctx *context.Context) {
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
divOnly := ctx.FormBool("div-only")
queryParams := ctx.Req.URL.Query()
queryParams.Del("div-only")
paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
paginator.AddParamFromRequest(ctx.Req)
paginator.AddParamFromQuery(queryParams)
ctx.Data["Page"] = paginator
if ctx.FormBool("div-only") {
if divOnly {
ctx.HTML(http.StatusOK, tplGraphDiv)
return
}