diff options
author | Gogs <gogitservice@gmail.com> | 2014-03-19 23:23:30 +0800 |
---|---|---|
committer | Gogs <gogitservice@gmail.com> | 2014-03-19 23:23:30 +0800 |
commit | c6e12d256833095d76bbb5755261507ecbdaada9 (patch) | |
tree | a9520d6632ee5365e9c5a6e63d86be03478dd08b /routers/repo | |
parent | a22c4ba71d4d61f40ba93230810bb612b2a50b6f (diff) |
add up url in file list
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/single.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go index 171b0952..0bfc8ffb 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -5,6 +5,7 @@ package repo import ( + "fmt" "strings" "github.com/codegangsta/martini" @@ -87,6 +88,11 @@ func Single(ctx *middleware.Context, params martini.Params) { for i, _ := range treenames { Paths = append(Paths, strings.Join(treenames[0:i+1], "/")) } + + ctx.Data["HasParentPath"] = true + if len(Paths)-2 >= 0 { + ctx.Data["ParentPath"] = "/" + Paths[len(Paths)-2] + } } // Get latest commit according username and repo name @@ -126,6 +132,8 @@ func Single(ctx *middleware.Context, params martini.Params) { } } + fmt.Println(Paths) + ctx.Data["Paths"] = Paths ctx.Data["Treenames"] = treenames ctx.Data["IsRepoToolbarSource"] = true |