diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-06 23:14:45 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-06 23:14:45 +0800 |
commit | 4c1858c07b972e64d47218646f89b2fb5340a993 (patch) | |
tree | 60a6c80471367084c3c785f2d1686748bb63fbf4 | |
parent | 9cd14f97c2eac15ff15d3da3ddb95411345cbc81 (diff) | |
download | gitea-4c1858c07b972e64d47218646f89b2fb5340a993.tar.gz gitea-4c1858c07b972e64d47218646f89b2fb5340a993.zip |
navbar active status
-rwxr-xr-x | public/css/gogs.css | 12 | ||||
-rw-r--r-- | routers/dashboard.go | 3 | ||||
-rw-r--r-- | routers/user/user.go | 1 | ||||
-rw-r--r-- | templates/base/navbar.tmpl | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css index 471c796dfb..6580d907a6 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -20,6 +20,10 @@ body { border-bottom-color: #333 !important; } +.tooltip-arrow:before { + border-bottom-color: transparent !important; +} + .fa { margin: 0 .5em; } @@ -39,6 +43,7 @@ body { font-weight: bold; color: #EEE; font-size: 100%; + height: 46px; } .gogs-nav-item:hover, @@ -55,6 +60,7 @@ body { cursor: pointer; margin-top: 8px; padding: 5px 15px; + height: 30px; } .gogs-nav-item.navbar-right .fa { @@ -68,7 +74,7 @@ body { .gogs-nav .active:after { position: absolute; - bottom: -2px; + bottom: -1px; left: 50%; width: 0; height: 0; @@ -80,6 +86,10 @@ body { border-left: 5px solid transparent; } +#gogs-nav-logo:after { + bottom: -4px !important; +} + .gogs-nav .tooltip { border: none; } diff --git a/routers/dashboard.go b/routers/dashboard.go index c154623820..8eda9cf248 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -16,5 +16,6 @@ func Home(r render.Render, data base.TmplData, session sessions.Session) { user.Dashboard(r, data, session) return } - r.HTML(200, "home", nil) + data["PageIsHome"] = true + r.HTML(200, "home", data) } diff --git a/routers/user/user.go b/routers/user/user.go index 5cec6deb23..46d4154e1e 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -27,6 +27,7 @@ func Dashboard(r render.Render, data base.TmplData, session sessions.Session) { data["IsSigned"] = true data["SignedUserId"] = SignedInId(session) data["SignedUserName"] = SignedInName(session) + data["PageIsUserDashboard"] = true data["Title"] = "Dashboard" r.HTML(200, "user/dashboard", data) diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl index 82fc3ae180..a52ce6c034 100644 --- a/templates/base/navbar.tmpl +++ b/templates/base/navbar.tmpl @@ -1,8 +1,8 @@ <div class="gogs-masthead navbar navbar-fixed-top" id="masthead"> <div class="container"> <nav class="gogs-nav"> - <a class="gogs-nav-item active" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a> - <a class="gogs-nav-item" href="#">Dashboard</a> + <a id="gogs-nav-logo" class="gogs-nav-item{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></a> + <a class="gogs-nav-item{{if .PageIsUserDashboard}} active{{end}}" href="#">Dashboard</a> <a class="gogs-nav-item" href="#">Explore</a> <a class="gogs-nav-item" href="#">Help</a>{{if .IsSigned}} <a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/"><i class="fa fa-power-off fa-lg"></i></a> |