navbar.tmpl 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="masthead navbar" id="masthead">
  2. <div class="container">
  3. <nav class="nav">
  4. <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/"><img src="{{AppSubUrl}}/img/favicon.png" alt="Gogs Logo" id="logo"></a>
  5. <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="{{AppSubUrl}}/">Dashboard</a>
  6. <a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>
  7. {{if .IsSigned}}
  8. {{if .HasAccess}}
  9. <!-- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
  10. <div class="input-group">
  11. <div class="input-group-btn">
  12. <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>
  13. <ul class="dropdown-menu">
  14. {{if .Repository}}
  15. <li><a href="#">This Repository</a></li>
  16. <li class="divider"></li>
  17. {{end}}
  18. <li><a href="#">All Repositories</a></li>
  19. </ul>
  20. </div>
  21. <input type="search" class="form-control input-sm" name="q" placeholder="search code, commits and issues"/>
  22. </div>
  23. </form> -->
  24. {{end}}
  25. <a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppSubUrl}}/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
  26. <a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
  27. <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
  28. </a>
  29. <a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="{{AppSubUrl}}/user/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
  30. {{if .IsAdmin}}
  31. <a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="{{AppSubUrl}}/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
  32. {{end}}
  33. <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">
  34. <button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
  35. <div class="dropdown-menu">
  36. <ul class="list-unstyled">
  37. <li><a href="{{AppSubUrl}}/repo/create"><i class="fa fa-book"></i>Repository</a></li>
  38. <li><a href="{{AppSubUrl}}/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
  39. <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
  40. </ul>
  41. </div>
  42. </div>
  43. {{else}}
  44. <a id="nav-signin" class="nav-item navbar-right navbar-btn btn btn-danger" href="{{AppSubUrl}}/user/login/" rel="nofollow">Sign In</a>
  45. <a id="nav-signup" class="nav-item navbar-right" href="{{AppSubUrl}}/user/sign_up/" rel="nofollow">Sign Up</a>
  46. {{end}}
  47. </nav>
  48. </div>
  49. </div>