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

head_navbar.tmpl 9.0 kB

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