From c101471bdfd0a802e66adfb7402dbd980812da30 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Mon, 17 Mar 2014 13:12:28 +0800 Subject: [PATCH] ui update, repo-assignment panic bug fix --- modules/middleware/repo.go | 2 +- public/css/gogs.css | 1 + routers/repo/single.go | 2 -- templates/base/head.tmpl | 4 +++- templates/repo/toolbar.tmpl | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 8cdc6df718d..7a4157367ec 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -24,7 +24,6 @@ func RepoAssignment(redirect bool) martini.Handler { // get repository owner ctx.Repo.IsOwner = ctx.IsSigned && ctx.User.LowerName == params["username"] - ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner if !ctx.Repo.IsOwner { user, err = models.GetUserByName(params["username"]) @@ -70,5 +69,6 @@ func RepoAssignment(redirect bool) martini.Handler { ctx.Data["Owner"] = user ctx.Data["Title"] = user.Name + "/" + repo.Name ctx.Data["RepositoryLink"] = ctx.Data["Title"] + ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner } } diff --git a/public/css/gogs.css b/public/css/gogs.css index 2c05d27ecb9..f98cf7a184d 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -10,6 +10,7 @@ body { html, body { height: 100%; + font-family: Helvetica, Arial, sans-serif; } /* override bs3 */ diff --git a/routers/repo/single.go b/routers/repo/single.go index 6bf03ca2b8a..3541dac9374 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -46,7 +46,6 @@ func Single(ctx *middleware.Context, params martini.Params) { ctx.Data["Paths"] = Paths ctx.Data["Treenames"] = treenames ctx.Data["IsRepoToolbarSource"] = true - ctx.Data["IsRepositoryOwner"] = strings.ToLower(params["username"]) == ctx.User.LowerName ctx.Data["Files"] = files ctx.Render.HTML(200, "repo/single", ctx.Data) } @@ -63,7 +62,6 @@ func Setting(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = title + " - settings" ctx.Data["IsRepoToolbarSetting"] = true - ctx.Data["IsRepositoryOwner"] = strings.ToLower(params["username"]) == ctx.User.LowerName ctx.Render.HTML(200, "repo/setting", ctx.Data) } diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index da100975925..f02ea095caf 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -3,7 +3,9 @@ - + + + diff --git a/templates/repo/toolbar.tmpl b/templates/repo/toolbar.tmpl index 4a0b60adadb..3729edaf5ce 100644 --- a/templates/repo/toolbar.tmpl +++ b/templates/repo/toolbar.tmpl @@ -5,8 +5,9 @@