diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-17 01:14:05 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-17 01:14:05 -0400 |
commit | 95cb7cb2add654da8b93be420014cad53ddbb1a4 (patch) | |
tree | b33e1f01fd91536d6277e6f06921d4234ba029ba /routers | |
parent | 0f68930892bc49966769f8931e9a531b37dacb3b (diff) | |
download | gitea-95cb7cb2add654da8b93be420014cad53ddbb1a4.tar.gz gitea-95cb7cb2add654da8b93be420014cad53ddbb1a4.zip |
Nothing
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/single.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go index 10b2ae8107..ac733b0b38 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/codegangsta/martini" + "github.com/slene/blackfriday" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/middleware" @@ -22,6 +23,7 @@ func Single(ctx *middleware.Context, params martini.Params) { params["branchname"] = "master" } + // Directory and file list. treename := params["_1"] files, err := models.GetReposFiles(params["username"], params["reponame"], params["branchname"], treename) @@ -33,6 +35,7 @@ func Single(ctx *middleware.Context, params martini.Params) { ctx.Data["Reponame"] = params["reponame"] ctx.Data["Branchname"] = params["branchname"] + // Branches. brs, err := models.GetBranches(params["username"], params["reponame"]) if err != nil { ctx.Handle(200, "repo.Single", err) @@ -50,6 +53,7 @@ func Single(ctx *middleware.Context, params martini.Params) { } } + // Latest commit. commit, err := models.GetLastestCommit(params["username"], params["reponame"]) if err != nil { ctx.Handle(200, "repo.Single", err) @@ -57,6 +61,15 @@ func Single(ctx *middleware.Context, params martini.Params) { } ctx.Data["LatestCommit"] = commit + // README. + // for _, f := range files { + // if f.Name == "README.md" { + // ctx.Data["ReadmeName"] = "README.md" + // ctx.Data["ReadmeContent"] = + // break + // } + // } + ctx.Data["Paths"] = Paths ctx.Data["Treenames"] = treenames ctx.Data["IsRepoToolbarSource"] = true |