summaryrefslogtreecommitdiffstats
path: root/routers/repo/single.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-15 12:13:48 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-15 12:13:48 -0400
commitf026ae86528bd77c6af5a72aa780e1b9d6064524 (patch)
treef21feafadd92bcc65238f6bffbceae8029021f2c /routers/repo/single.go
parentdfcae2a97ae57cf8cb9e954b9d69151f5e340745 (diff)
parent7ca830677525e6fc9127660fde32c46bcf00ab59 (diff)
downloadgitea-f026ae86528bd77c6af5a72aa780e1b9d6064524.tar.gz
gitea-f026ae86528bd77c6af5a72aa780e1b9d6064524.zip
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers/repo/single.go')
-rw-r--r--routers/repo/single.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index d796d9639d..a7f07898f0 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -10,12 +10,14 @@ import (
)
func Single(ctx *middleware.Context, params martini.Params) {
- if !ctx.Data["IsRepositoryValid"].(bool) {
+ if !ctx.Repo.IsValid {
return
}
+
if params["branchname"] == "" {
params["branchname"] = "master"
}
+
treename := params["_1"]
files, err := models.GetReposFiles(params["username"], params["reponame"],
params["branchname"], treename)
@@ -45,11 +47,16 @@ func Single(ctx *middleware.Context, params martini.Params) {
}
func Setting(ctx *middleware.Context) {
- if !ctx.Data["IsRepositoryValid"].(bool) {
+ if !ctx.Repo.IsValid {
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.Render.HTML(200, "repo/setting", ctx.Data)
}