diff options
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/commit.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 004d4915df..d9547cc51d 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -90,6 +90,11 @@ func Commits(ctx *context.Context) { func Graph(ctx *context.Context) { ctx.Data["PageIsCommits"] = true ctx.Data["PageIsViewCode"] = true + mode := strings.ToLower(ctx.QueryTrim("mode")) + if mode != "monochrome" { + mode = "color" + } + ctx.Data["Mode"] = mode commitsCount, err := ctx.Repo.GetCommitsCount() if err != nil { @@ -105,7 +110,7 @@ func Graph(ctx *context.Context) { page := ctx.QueryInt("page") - graph, err := gitgraph.GetCommitGraph(ctx.Repo.GitRepo, page) + graph, err := gitgraph.GetCommitGraph(ctx.Repo.GitRepo, page, 0) if err != nil { ctx.ServerError("GetCommitGraph", err) return @@ -116,7 +121,9 @@ func Graph(ctx *context.Context) { ctx.Data["Reponame"] = ctx.Repo.Repository.Name ctx.Data["CommitCount"] = commitsCount ctx.Data["Branch"] = ctx.Repo.BranchName - ctx.Data["Page"] = context.NewPagination(int(allCommitsCount), setting.UI.GraphMaxCommitNum, page, 5) + paginator := context.NewPagination(int(allCommitsCount), setting.UI.GraphMaxCommitNum, page, 5) + paginator.AddParam(ctx, "mode", "Mode") + ctx.Data["Page"] = paginator ctx.HTML(200, tplGraph) } |