From bf703ef61761fc4b09e3cb95672869520eccbc39 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Sun, 22 Jun 2014 14:10:12 +0800 Subject: [PATCH 1/3] add dashboard context switch button --- cmd/web.go | 2 +- public/css/gogs.css | 41 +++++++++++++++++++++++++++++++++++ routers/dashboard.go | 2 +- templates/user/dashboard.tmpl | 14 ++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index 2fdfe4332..f62bc2550 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -96,7 +96,7 @@ func runWeb(*cli.Context) { r.Get("/stars", user.Stars) }, reqSignIn) - m.Group("/api", func(r martini.Router) { + m.Group("/api", func(_ martini.Router) { m.Group("/v1", func(r martini.Router) { // Miscellaneous. r.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown) diff --git a/public/css/gogs.css b/public/css/gogs.css index 1e29eeba5..67d1ebe58 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -638,6 +638,47 @@ html, body { margin: 0 .5em; } +#dashboard-switch .btn { + height: 40px; +} + +#dashboard-switch { + margin-top: 14px; + margin-right: 18px; +} + +#dashboard-switch .dropdown-menu { + padding: 0; +} + +#dashboard-switch-menu { + width: 180px; + margin-bottom: 0; + padding-bottom: 0; +} + +#dashboard-switch-menu > li > a { + display: block; + padding: .8em 1.2em; +} + +#dashboard-switch-menu > li { + border-bottom: 1px solid #eaeaea; +} + +#dashboard-switch-menu > li .fa { + opacity: 0; + margin-right: 16px; +} + +#dashboard-switch-menu > li.checked .fa { + opacity: 1; +} + +#dashboard-switch-menu > li:last-child { + border-bottom: none; +} + /* gogits repo single page */ #body-nav.repo-nav { diff --git a/routers/dashboard.go b/routers/dashboard.go index 438d03794..7daa0e7ba 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -26,7 +26,7 @@ func Home(ctx *middleware.Context) { ctx.Data["PageIsHome"] = true - // Show recent updated repositoires for new visiters. + // Show recent updated repositories for new visitors. repos, err := models.GetRecentUpdatedRepositories() if err != nil { ctx.Handle(500, "dashboard.Home(GetRecentUpdatedRepositories)", err) diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index 5cda6722f..c44ba3627 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -2,6 +2,20 @@ {{template "base/navbar" .}}
+
+ + + +