summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorjaqra <48099350+jaqra@users.noreply.github.com>2019-10-15 00:38:35 +0300
committerzeripath <art27@cantab.net>2019-10-14 22:38:35 +0100
commit086bfb8b4b655f46ac9471cbea9df70e912c315d (patch)
treef89c2f17afa05b622e644a81ae09c087d83452b3 /routers
parent30835226207f9a618bb2d4956fb209b1dbe099e6 (diff)
downloadgitea-086bfb8b4b655f46ac9471cbea9df70e912c315d.tar.gz
gitea-086bfb8b4b655f46ac9471cbea9df70e912c315d.zip
Add pagination to commit graph page (#8360)
Fixes #8308
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/commit.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 3cedf70319..550e4c3a9c 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -91,7 +91,9 @@ func Graph(ctx *context.Context) {
return
}
- graph, err := models.GetCommitGraph(ctx.Repo.GitRepo)
+ page := ctx.QueryInt("page")
+
+ graph, err := models.GetCommitGraph(ctx.Repo.GitRepo, page)
if err != nil {
ctx.ServerError("GetCommitGraph", err)
return
@@ -103,8 +105,8 @@ func Graph(ctx *context.Context) {
ctx.Data["CommitCount"] = commitsCount
ctx.Data["Branch"] = ctx.Repo.BranchName
ctx.Data["RequireGitGraph"] = true
+ ctx.Data["Page"] = context.NewPagination(int(commitsCount), setting.UI.GraphMaxCommitNum, page, 5)
ctx.HTML(200, tplGraph)
-
}
// SearchCommits render commits filtered by keyword