0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 09:12:57 +01:00

navbar active status

This commit is contained in:
FuXiaoHei 2014-03-06 23:14:45 +08:00
parent 9cd14f97c2
commit 4c1858c07b
4 changed files with 16 additions and 4 deletions

View file

@ -20,6 +20,10 @@ body {
border-bottom-color: #333 !important; border-bottom-color: #333 !important;
} }
.tooltip-arrow:before {
border-bottom-color: transparent !important;
}
.fa { .fa {
margin: 0 .5em; margin: 0 .5em;
} }
@ -39,6 +43,7 @@ body {
font-weight: bold; font-weight: bold;
color: #EEE; color: #EEE;
font-size: 100%; font-size: 100%;
height: 46px;
} }
.gogs-nav-item:hover, .gogs-nav-item:hover,
@ -55,6 +60,7 @@ body {
cursor: pointer; cursor: pointer;
margin-top: 8px; margin-top: 8px;
padding: 5px 15px; padding: 5px 15px;
height: 30px;
} }
.gogs-nav-item.navbar-right .fa { .gogs-nav-item.navbar-right .fa {
@ -68,7 +74,7 @@ body {
.gogs-nav .active:after { .gogs-nav .active:after {
position: absolute; position: absolute;
bottom: -2px; bottom: -1px;
left: 50%; left: 50%;
width: 0; width: 0;
height: 0; height: 0;
@ -80,6 +86,10 @@ body {
border-left: 5px solid transparent; border-left: 5px solid transparent;
} }
#gogs-nav-logo:after {
bottom: -4px !important;
}
.gogs-nav .tooltip { .gogs-nav .tooltip {
border: none; border: none;
} }

View file

@ -16,5 +16,6 @@ func Home(r render.Render, data base.TmplData, session sessions.Session) {
user.Dashboard(r, data, session) user.Dashboard(r, data, session)
return return
} }
r.HTML(200, "home", nil) data["PageIsHome"] = true
r.HTML(200, "home", data)
} }

View file

@ -27,6 +27,7 @@ func Dashboard(r render.Render, data base.TmplData, session sessions.Session) {
data["IsSigned"] = true data["IsSigned"] = true
data["SignedUserId"] = SignedInId(session) data["SignedUserId"] = SignedInId(session)
data["SignedUserName"] = SignedInName(session) data["SignedUserName"] = SignedInName(session)
data["PageIsUserDashboard"] = true
data["Title"] = "Dashboard" data["Title"] = "Dashboard"
r.HTML(200, "user/dashboard", data) r.HTML(200, "user/dashboard", data)

View file

@ -1,8 +1,8 @@
<div class="gogs-masthead navbar navbar-fixed-top" id="masthead"> <div class="gogs-masthead navbar navbar-fixed-top" id="masthead">
<div class="container"> <div class="container">
<nav class="gogs-nav"> <nav class="gogs-nav">
<a class="gogs-nav-item active" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="gogs-logo"></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" href="#">Dashboard</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="#">Explore</a>
<a class="gogs-nav-item" href="#">Help</a>{{if .IsSigned}} <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> <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>