|
@@ -10,12 +10,14 @@ import (
|
|
)
|
|
)
|
|
|
|
|
|
func Single(ctx *middleware.Context, params martini.Params) {
|
|
func Single(ctx *middleware.Context, params martini.Params) {
|
|
- if !ctx.Data["IsRepositoryValid"].(bool) {
|
|
+ if !ctx.Repo.IsValid {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
if params["branchname"] == "" {
|
|
if params["branchname"] == "" {
|
|
params["branchname"] = "master"
|
|
params["branchname"] = "master"
|
|
}
|
|
}
|
|
|
|
+
|
|
treename := params["_1"]
|
|
treename := params["_1"]
|
|
files, err := models.GetReposFiles(params["username"], params["reponame"],
|
|
files, err := models.GetReposFiles(params["username"], params["reponame"],
|
|
params["branchname"], treename)
|
|
params["branchname"], treename)
|
|
@@ -41,16 +43,20 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|
ctx.Data["Treenames"] = treenames
|
|
ctx.Data["Treenames"] = treenames
|
|
ctx.Data["IsRepoToolbarSource"] = true
|
|
ctx.Data["IsRepoToolbarSource"] = true
|
|
ctx.Data["Files"] = files
|
|
ctx.Data["Files"] = files
|
|
-
|
|
|
|
ctx.Render.HTML(200, "repo/single", ctx.Data)
|
|
ctx.Render.HTML(200, "repo/single", ctx.Data)
|
|
}
|
|
}
|
|
|
|
|
|
func Setting(ctx *middleware.Context) {
|
|
func Setting(ctx *middleware.Context) {
|
|
- if !ctx.Data["IsRepositoryValid"].(bool) {
|
|
+ if !ctx.Repo.IsValid {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
- ctx.Data["Title"] = ctx.Data["Title"].(string) + " - settings"
|
|
+ var title string
|
|
|
|
+ if t, ok := ctx.Data["Title"].(string); ok {
|
|
|
|
+ title = t
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ctx.Data["Title"] = title + " - settings"
|
|
ctx.Data["IsRepoToolbarSetting"] = true
|
|
ctx.Data["IsRepoToolbarSetting"] = true
|
|
ctx.Render.HTML(200, "repo/setting", ctx.Data)
|
|
ctx.Render.HTML(200, "repo/setting", ctx.Data)
|
|
}
|
|
}
|