From fbd252c1cf26009e8880c632c8154361db33175e Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 18 Mar 2014 18:31:54 -0400 Subject: [PATCH] Mirror fix --- routers/dashboard.go | 5 +++-- routers/repo/single.go | 10 ++++++---- routers/user/setting.go | 13 +++++++++---- routers/user/user.go | 18 ++++++++++-------- templates/base/navbar.tmpl | 2 +- templates/help.tmpl | 11 +++++++++++ templates/home.tmpl | 2 +- templates/repo/issues.tmpl | 9 +++++++++ templates/repo/pulls.tmpl | 9 +++++++++ templates/user/issues.tmpl | 17 +++++++++++++++++ templates/user/notification.tmpl | 12 +----------- templates/user/password.tmpl | 26 ++++++++------------------ templates/user/publickey.tmpl | 13 +------------ templates/user/pulls.tmpl | 17 +++++++++++++++++ templates/user/security.tmpl | 12 +----------- templates/user/setting.tmpl | 12 +----------- templates/user/setting_nav.tmpl | 11 +++++++++++ templates/user/stars.tmpl | 17 +++++++++++++++++ 18 files changed, 133 insertions(+), 83 deletions(-) create mode 100644 templates/help.tmpl create mode 100644 templates/repo/issues.tmpl create mode 100644 templates/repo/pulls.tmpl create mode 100644 templates/user/issues.tmpl create mode 100644 templates/user/pulls.tmpl create mode 100644 templates/user/setting_nav.tmpl create mode 100644 templates/user/stars.tmpl diff --git a/routers/dashboard.go b/routers/dashboard.go index ddaef0cb56..d5358f0a00 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -18,6 +18,7 @@ func Home(ctx *middleware.Context) { ctx.Render.HTML(200, "home", ctx.Data) } -func Help(ctx *middleware.Context) string { - return "This is help page" +func Help(ctx *middleware.Context) { + ctx.Data["PageIsHelp"] = true + ctx.Render.HTML(200, "help", ctx.Data) } diff --git a/routers/repo/single.go b/routers/repo/single.go index 0cc41b1c8f..d64248d990 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -182,10 +182,12 @@ func Commits(ctx *middleware.Context, params martini.Params) { ctx.Render.HTML(200, "repo/commits", ctx.Data) } -func Issues(ctx *middleware.Context) string { - return "This is issues page" +func Issues(ctx *middleware.Context) { + ctx.Data["IsRepoToolbarIssues"] = true + ctx.Render.HTML(200, "repo/issues", ctx.Data) } -func Pulls(ctx *middleware.Context) string { - return "This is pulls page" +func Pulls(ctx *middleware.Context) { + ctx.Data["IsRepoToolbarPulls"] = true + ctx.Render.HTML(200, "repo/pulls", ctx.Data) } diff --git a/routers/user/setting.go b/routers/user/setting.go index ea42f70cfa..3f60c6c6fb 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -14,10 +14,11 @@ import ( "github.com/gogits/gogs/modules/middleware" ) -// render user setting page (email, website modify) +// Render user setting page (email, website modify) func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { ctx.Data["Title"] = "Setting" - ctx.Data["PageIsUserSetting"] = true + ctx.Data["PageIsUserSetting"] = true // For navbar arrow. + ctx.Data["IsUserPageSetting"] = true // For setting nav highlight. user := ctx.User ctx.Data["Owner"] = user @@ -50,6 +51,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) { func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) { ctx.Data["Title"] = "Password" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingPasswd"] = true if ctx.Req.Method == "GET" { ctx.Render.HTML(200, "user/password", ctx.Data) @@ -149,20 +151,23 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) { } ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingSSH"] = true ctx.Data["Keys"] = keys ctx.Render.HTML(200, "user/publickey", ctx.Data) } func SettingNotification(ctx *middleware.Context) { - // todo user setting notification + // TODO: user setting notification ctx.Data["Title"] = "Notification" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingNotify"] = true ctx.Render.HTML(200, "user/notification", ctx.Data) } func SettingSecurity(ctx *middleware.Context) { - // todo user setting security + // TODO: user setting security ctx.Data["Title"] = "Security" ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingSecurity"] = true ctx.Render.HTML(200, "user/security", ctx.Data) } diff --git a/routers/user/user.go b/routers/user/user.go index c43cf84a24..f8c9b4d3dd 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -151,6 +151,8 @@ func SignUp(ctx *middleware.Context, form auth.RegisterForm) { func Delete(ctx *middleware.Context) { ctx.Data["Title"] = "Delete Account" + ctx.Data["PageIsUserSetting"] = true + ctx.Data["IsUserPageSettingDelete"] = true if ctx.Req.Method == "GET" { ctx.Render.HTML(200, "user/delete", ctx.Data) @@ -182,7 +184,7 @@ func Delete(ctx *middleware.Context) { } const ( - feedTpl = ` + TPL_FEED = `
%s
%s
` ) @@ -194,20 +196,20 @@ func Feeds(ctx *middleware.Context, form auth.FeedsForm) { feeds := make([]string, len(actions)) for i := range actions { - feeds[i] = fmt.Sprintf(feedTpl, base.ActionIcon(actions[i].OpType), + feeds[i] = fmt.Sprintf(TPL_FEED, base.ActionIcon(actions[i].OpType), base.TimeSince(actions[i].Created), base.ActionDesc(actions[i], ctx.User.AvatarLink())) } ctx.Render.JSON(200, &feeds) } -func Issues(ctx *middleware.Context) string { - return "This is issues page" +func Issues(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/issues", ctx.Data) } -func Pulls(ctx *middleware.Context) string { - return "This is pulls page" +func Pulls(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/pulls", ctx.Data) } -func Stars(ctx *middleware.Context) string { - return "This is stars page" +func Stars(ctx *middleware.Context) { + ctx.Render.HTML(200, "user/stars", ctx.Data) } diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl index 181beb5a44..4902ce2593 100644 --- a/templates/base/navbar.tmpl +++ b/templates/base/navbar.tmpl @@ -3,7 +3,7 @@