summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 17:15:02 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 17:15:02 +0800
commitdf1985e1e8ff8a5173b3a80a6bcdaee13f6a0b1a (patch)
treef0b0a1861a344efc2f9fa45a1e2612a8348fb7d4 /routers
parent3a3ac1f0f32d44330d513cfea9ca3560bc41671e (diff)
parent0d6aafdef54183069a789054e95ffd080d1c09dd (diff)
downloadgitea-df1985e1e8ff8a5173b3a80a6bcdaee13f6a0b1a.tar.gz
gitea-df1985e1e8ff8a5173b3a80a6bcdaee13f6a0b1a.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/single.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index 625fe9f193..c144106cb8 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"
@@ -42,6 +43,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)
@@ -53,6 +55,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)
@@ -70,6 +73,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)
@@ -77,6 +81,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