Browse Source

nav ui for user logged

pull/31/head
FuXiaoHei 11 years ago
parent
commit
39ac95e5a2
  1. 35
      public/css/gogs.css
  2. 5
      public/js/app.js
  3. 5
      templates/base/footer.tmpl
  4. 11
      templates/base/navbar.tmpl
  5. 1
      templates/user/profile.tmpl

35
public/css/gogs.css

@ -28,8 +28,7 @@ body {
.gogs-masthead { .gogs-masthead {
background-color: #428bca; background-color: #428bca;
box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1); box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .1);
min-height: 45px; padding: 0 16px;
padding: 2px 16px;
} }
/* gogits nav item link */ /* gogits nav item link */
@ -54,6 +53,14 @@ body {
padding: 5px 15px; padding: 5px 15px;
} }
.gogs-nav-item.navbar-right {
margin-top: 3px;
}
.gogs-nav-item.navbar-right .fa{
margin: 0;
}
/* gogits nav item active status */ /* gogits nav item active status */
.gogs-nav .active { .gogs-nav .active {
color: #fff; color: #fff;
@ -73,15 +80,37 @@ body {
border-left: 5px solid transparent; border-left: 5px solid transparent;
} }
.gogs-nav .tooltip{
border: none;
}
/* gogits logo */ /* gogits logo */
#gogs-logo { #gogs-nav-avatar {
margin-top: 0;
}
#gogs-logo, #gogs-nav-avatar img {
width: 28px; width: 28px;
height: 28px;
}
#gogs-nav-out {
margin-top: 10px;
padding: 5px 0;
margin-left: 10px;
height: 28px;
}
#gogs-nav-out .fa {
vertical-align: -10%;
margin: 0 .5em;
} }
/* gogits body */ /* gogits body */
#gogs-body { #gogs-body {
padding-top: 30px; padding-top: 30px;
padding-bottom: 60px; padding-bottom: 60px;
margin-top: 50px;
} }
/* gogits login card */ /* gogits login card */

5
public/js/app.js

@ -15,3 +15,8 @@ var Gogits = {};
$(selector).find("li:eq(" + index + ") a").tab("show"); $(selector).find("li:eq(" + index + ") a").tab("show");
} }
})(jQuery); })(jQuery);
function initCore(){
Gogits.showTooltips();
}

5
templates/base/footer.tmpl

@ -1,2 +1,7 @@
<script>
$(function(){
initCore();
});
</script>
</body> </body>
</html> </html>

11
templates/base/navbar.tmpl

@ -1,12 +1,17 @@
<div class="gogs-masthead" 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 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 class="gogs-nav-item" 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> <a class="gogs-nav-item" href="#">Help</a>
<a class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/login/">Sign in</a> <!--<a class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/login/">Sign in</a>-->
<!--<a class="gogs-nav-item navbar-right" href="#">Profile</a>--> <a id="gogs-nav-out" class="gogs-nav-item navbar-right navbar-btn btn btn-danger" href="/login/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="gogs-nav-avatar" class="gogs-nav-item navbar-right" href="/user/profile" data-toggle="tooltip" data-placement="bottom" title="Username">
<img src="http://1.gravatar.com/avatar/x?s=28" alt="user-avatar" title="username"/>
</a>
<a class="navbar-right gogs-nav-item" href="/repo/create" data-toggle="tooltip" data-placement="bottom" title="New Repository"><i class="fa fa-plus fa-lg"></i></a>
<a class="navbar-right gogs-nav-item" href="#" data-toggle="tooltip" data-placement="bottom" title="Setting"><i class="fa fa-cogs fa-lg"></i></a>
</nav> </nav>
</div> </div>
</div> </div>

1
templates/user/profile.tmpl

@ -30,7 +30,6 @@
</div> </div>
<script> <script>
$(function () { $(function () {
Gogits.showTooltips();
Gogits.showTab("#gogs-user-act-tabs"); Gogits.showTab("#gogs-user-act-tabs");
}); });
</script> </script>

Loading…
Cancel
Save