@@ -18,6 +18,7 @@ import (
18
18
19
19
const (
20
20
tplCommits base.TplName = "repo/commits"
21
+ tplGraph base.TplName = "repo/graph"
21
22
tplDiff base.TplName = "repo/diff/page"
22
23
)
23
24
@@ -75,6 +76,32 @@ func Commits(ctx *context.Context) {
75
76
ctx .HTML (200 , tplCommits )
76
77
}
77
78
79
+ // Graph render commit graph - show commits from all branches.
80
+ func Graph (ctx * context.Context ) {
81
+ ctx .Data ["PageIsCommits" ] = true
82
+
83
+ commitsCount , err := ctx .Repo .Commit .CommitsCount ()
84
+ if err != nil {
85
+ ctx .Handle (500 , "GetCommitsCount" , err )
86
+ return
87
+ }
88
+
89
+ graph , err := models .GetCommitGraph (ctx .Repo .GitRepo )
90
+ if err != nil {
91
+ ctx .Handle (500 , "GetCommitGraph" , err )
92
+ return
93
+ }
94
+
95
+ ctx .Data ["Graph" ] = graph
96
+ ctx .Data ["Username" ] = ctx .Repo .Owner .Name
97
+ ctx .Data ["Reponame" ] = ctx .Repo .Repository .Name
98
+ ctx .Data ["CommitCount" ] = commitsCount
99
+ ctx .Data ["Branch" ] = ctx .Repo .BranchName
100
+ ctx .Data ["RequireGitGraph" ] = true
101
+ ctx .HTML (200 , tplGraph )
102
+
103
+ }
104
+
78
105
// SearchCommits render commits filtered by keyword
79
106
func SearchCommits (ctx * context.Context ) {
80
107
ctx .Data ["PageIsCommits" ] = true
0 commit comments