header.tmpl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <header id="header">
  2. <ul class="menu menu-line container" id="header-nav">
  3. {{if not .PageIsHome}}
  4. <li class="head" id="header-nav-logo">
  5. <img src="{{AppSubUrl}}/img/favicon.png" alt="avatar" class="avatar-30"/>
  6. </li>
  7. <li {{if .PageIsDashboard}}class="current"{{end}}>
  8. <a href="{{AppSubUrl}}/">{{if .IsSigned}}{{.i18n.Tr "dashboard"}}{{else}}{{.i18n.Tr "home"}}{{end}}</a>
  9. </li>
  10. <li><a href="{{AppSubUrl}}/explore">{{.i18n.Tr "explore"}}</a></li>
  11. <li><a target="_blank" href="http://gogs.io/docs">{{.i18n.Tr "help"}}</a></li>
  12. {{end}}
  13. {{if .IsSigned}}
  14. <li class="right" id="header-nav-sign-out">
  15. <a href="{{AppSubUrl}}/user/logout" title="{{.i18n.Tr "sign_out"}}"><i class="octicon octicon-sign-out"></i></a>
  16. </li>
  17. <li class="right {{if .PageIsUserSettings}}current{{end}}">
  18. <a href="{{AppSubUrl}}/user/settings" title="{{.i18n.Tr "account_settings"}}"><i class="octicon octicon-settings"></i></a>
  19. </li>
  20. {{if .IsAdmin}}
  21. <li class="right {{if .PageIsAdmin}}current{{end}}">
  22. <a href="{{AppSubUrl}}/admin" title="{{.i18n.Tr "admin_panel"}}"><i class="octicon octicon-circuit-board"></i></a>
  23. </li>
  24. {{end}}
  25. <li class="right down">
  26. <a href="#"><i class="octicon octicon-plus"></i></a>
  27. <ul class="menu menu-down" id="header-new-repo-menu">
  28. <li><a href="{{AppSubUrl}}/repo/create"><i class="octicon octicon-repo-create"></i>{{.i18n.Tr "new_repo"}}</a></li>
  29. <li><a href="{{AppSubUrl}}/repo/migrate"><i class="octicon octicon-repo-clone"></i>{{.i18n.Tr "new_migrate"}}</a></li>
  30. <li><a href="{{AppSubUrl}}/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li>
  31. </ul>
  32. </li>
  33. <li class="right" id="header-nav-user">
  34. <a href="{{AppSubUrl}}/{{.SignedUser.Name}}" class="text-bold">
  35. <img src="{{.SignedUser.AvatarLink}}" alt="user-avatar" class="avatar-30"/>
  36. {{.SignedUser.Name}}
  37. </a>
  38. </li>
  39. {{else}}
  40. {{if .PageIsHome}}
  41. <li class="right" id="header-nav-help">
  42. <a target="_blank" href="http://gogs.io/docs"><i class="octicon octicon-info"></i>&nbsp;&nbsp;{{.i18n.Tr "help"}}</a>
  43. </li>
  44. <li class="right" id="header-nav-explore">
  45. <a href="{{AppSubUrl}}/explore"><i class="octicon octicon-globe"></i>&nbsp;&nbsp;{{.i18n.Tr "explore"}}</a>
  46. </li>
  47. {{else}}
  48. <li class="right" id="header-nav-sign-in">
  49. <a href="{{AppSubUrl}}/user/login" title="Sign In"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a>
  50. </li>
  51. {{if .ShowRegistrationButton}}
  52. <li class="right">
  53. <a href="{{AppSubUrl}}/user/sign_up" title="Account Settings"><i class="octicon octicon-person-add"></i> {{.i18n.Tr "register"}}</a>
  54. </li>
  55. {{end}}
  56. {{end}}
  57. {{end}}
  58. </ul>
  59. </header>