Fix git graph page (#34948)
Some checks failed
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
release-nightly / nightly-docker-rootless (push) Has been cancelled
cron-translations / crowdin-pull (push) Has been cancelled

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
}