You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

head_navbar.tmpl 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <div class="ui container" id="navbar">
  2. <div class="item brand" style="justify-content: space-between;">
  3. <a href="{{AppSubUrl}}/">
  4. <img class="ui mini image" src="{{StaticUrlPrefix}}/img/gitea-sm.png">
  5. </a>
  6. <div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
  7. <i class="sidebar icon"></i>
  8. </div>
  9. </div>
  10. {{if and .IsSigned .MustChangePassword}}
  11. {{/* No links */}}
  12. {{else if .IsSigned}}
  13. <a class="item {{if .PageIsDashboard}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
  14. {{if not .UnitIssuesGlobalDisabled}}
  15. <a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
  16. {{end}}
  17. {{if not .UnitPullsGlobalDisabled}}
  18. <a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  19. {{end}}
  20. {{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
  21. {{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="{{AppSubUrl}}/milestones">{{.i18n.Tr "milestones"}}</a>{{end}}
  22. {{end}}
  23. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  24. {{else if .IsLandingPageHome}}
  25. <a class="item {{if .PageIsHome}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
  26. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  27. {{else if .IsLandingPageExplore}}
  28. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "home"}}</a>
  29. {{else if .IsLandingPageOrganizations}}
  30. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "home"}}</a>
  31. {{end}}
  32. {{template "custom/extra_links" .}}
  33. {{/*
  34. <div class="item">
  35. <div class="ui icon input">
  36. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  37. <i class="search icon"></i>
  38. </div>
  39. </div>
  40. */}}
  41. {{if and .IsSigned .MustChangePassword}}
  42. <div class="right stackable menu">
  43. <div class="ui dropdown jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  44. <span class="text">
  45. <img class="ui tiny avatar image" width="24" height="24" src="{{.SignedUser.RelAvatarLink}}">
  46. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  47. <span class="mobile-only">{{.SignedUser.Name}}</span>
  48. <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down" 16}}</span>
  49. </span>
  50. <div class="menu user-menu" tabindex="-1">
  51. <div class="ui header">
  52. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  53. </div>
  54. <div class="divider"></div>
  55. <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
  56. {{svg "octicon-sign-out" 16}}
  57. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  58. </a>
  59. </div><!-- end content avatar menu -->
  60. </div><!-- end dropdown avatar menu -->
  61. </div>
  62. {{else if .IsSigned}}
  63. <div class="right stackable menu">
  64. <a href="{{AppSubUrl}}/notifications" class="item poping up" data-content='{{.i18n.Tr "notifications"}}' data-variation="tiny inverted">
  65. <span class="text">
  66. <span class="fitted">{{svg "octicon-bell" 16}}</span>
  67. <span class="sr-mobile-only">{{.i18n.Tr "notifications"}}</span>
  68. {{$notificationUnreadCount := 0}}
  69. {{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
  70. <span class="ui red label {{if not $notificationUnreadCount}}hidden{{end}} notification_count">
  71. {{$notificationUnreadCount}}
  72. </span>
  73. </span>
  74. </a>
  75. <div class="ui dropdown jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  76. <span class="text">
  77. <span class="fitted">{{svg "octicon-plus" 16}}</span>
  78. <span class="sr-mobile-only">{{.i18n.Tr "create_new"}}</span>
  79. <span class="fitted not-mobile">{{svg "octicon-triangle-down" 16}}</span>
  80. </span>
  81. <div class="menu">
  82. <a class="item" href="{{AppSubUrl}}/repo/create">
  83. <span class="fitted">{{svg "octicon-plus" 16}}</span> {{.i18n.Tr "new_repo"}}
  84. </a>
  85. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  86. <span class="fitted">{{svg "octicon-repo-clone" 16}}</span> {{.i18n.Tr "new_migrate"}}
  87. </a>
  88. {{if .SignedUser.CanCreateOrganization}}
  89. <a class="item" href="{{AppSubUrl}}/org/create">
  90. <span class="fitted">{{svg "octicon-organization" 16}}</span> {{.i18n.Tr "new_org"}}
  91. </a>
  92. {{end}}
  93. </div><!-- end content create new menu -->
  94. </div><!-- end dropdown menu create new -->
  95. <div class="ui dropdown jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  96. <span class="text">
  97. <img class="ui tiny avatar image" width="24" height="24" src="{{.SignedUser.RelAvatarLink}}">
  98. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  99. <span class="mobile-only">{{.SignedUser.Name}}</span>
  100. <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down" 16}}</span>
  101. </span>
  102. <div class="menu user-menu" tabindex="-1">
  103. <div class="ui header">
  104. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  105. </div>
  106. <div class="divider"></div>
  107. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  108. {{svg "octicon-person" 16}}
  109. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  110. </a>
  111. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}?tab=stars">
  112. {{svg "octicon-star" 16}}
  113. {{.i18n.Tr "your_starred"}}
  114. </a>
  115. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  116. {{svg "octicon-settings" 16}}
  117. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  118. </a>
  119. <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">
  120. {{svg "octicon-question" 16}}
  121. {{.i18n.Tr "help"}}<!-- Help -->
  122. </a>
  123. {{if .IsAdmin}}
  124. <div class="divider"></div>
  125. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  126. <i class="icon settings"></i>
  127. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  128. </a>
  129. {{end}}
  130. <div class="divider"></div>
  131. <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
  132. {{svg "octicon-sign-out" 16}}
  133. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  134. </a>
  135. </div><!-- end content avatar menu -->
  136. </div><!-- end dropdown avatar menu -->
  137. </div><!-- end signed user right menu -->
  138. {{else}}
  139. <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.i18n.Tr "help"}}</a>
  140. <div class="right stackable menu">
  141. {{if .ShowRegistrationButton}}
  142. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  143. {{svg "octicon-person" 16}} {{.i18n.Tr "register"}}
  144. </a>
  145. {{end}}
  146. <a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  147. {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}}
  148. </a>
  149. </div><!-- end anonymous right menu -->
  150. {{end}}
  151. </div>