summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorslene <vslene@gmail.com>2014-03-16 00:03:23 +0800
committerslene <vslene@gmail.com>2014-03-16 00:03:23 +0800
commit7ca830677525e6fc9127660fde32c46bcf00ab59 (patch)
tree3e4234b6f59a64783c173ff43dec239a263f97f7 /routers
parentf047df6e2b69ecb41c3fe4bef746145916aa4063 (diff)
downloadgitea-7ca830677525e6fc9127660fde32c46bcf00ab59.tar.gz
gitea-7ca830677525e6fc9127660fde32c46bcf00ab59.zip
modify RepoAssignment
Diffstat (limited to 'routers')
-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 e933951050..bd5cfa1196 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)
@@ -46,11 +48,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)
}