Browse Source

navbar active status

pull/31/head
FuXiaoHei 11 years ago
parent
commit
4c1858c07b
  1. 12
      public/css/gogs.css
  2. 3
      routers/dashboard.go
  3. 1
      routers/user/user.go
  4. 4
      templates/base/navbar.tmpl

12
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;
}

3
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)
}

1
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)

4
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>

Loading…
Cancel
Save