gitea/templates/base/navbar.tmpl

50 lines
3.5 KiB
Cheetah

<div class="masthead navbar" id="masthead">
<div class="container">
<nav class="nav">
<a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
<a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
<a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>
{{if .IsSigned}}
{{if .HasAccess}}
<!-- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">{{if .Repository}}This Repository{{else}}All Repositories{{end}} <span class="caret"></span></button>
<ul class="dropdown-menu">
{{if .Repository}}
<li><a href="#">This Repository</a></li>
<li class="divider"></li>
{{end}}
<li><a href="#">All Repositories</a></li>
</ul>
</div>
<input type="search" class="form-control input-sm" name="q" placeholder="search code, commits and issues"/>
</div>
</form> -->
{{end}}
<a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a>
<a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="/user/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
{{if .IsAdmin}}
<a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
{{end}}
<div class="navbar-right nav-item pull-right{{if .PageIsNewRepo}} active{{end}}" id="nav-repo-new" data-toggle="tooltip" data-placement="bottom" title="New Repo">
<button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
<div class="dropdown-menu">
<ul class="list-unstyled">
<li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
<li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
<!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
</ul>
</div>
</div>
{{else}}
<a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/login/" rel="nofollow">Sign In</a>
<a id="nav-signup" class="nav-item navbar-right" href="/user/sign_up/" rel="nofollow">Sign Up</a>
{{end}}
</nav>
</div>
</div>