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 8.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. 社区
  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">欢迎加入OpenI</a>
  17. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">组织结构</a>
  18. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">启智开源许可证</a>
  19. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">OpenI社区章程</a>
  20. <a class="item" href="https://www.openi.org.cn/html/news/dongtai/">社区动态</a>
  21. </div>
  22. </div>
  23. <a class="item" href="{{AppSubUrl}}/datasets">{{.i18n.Tr "datasets"}}</a>
  24. <a class="item" href="{{AppSubUrl}}/explore/repos">项目</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="javascript:alert('WIP')">学习</a>
  39. <a class="item" href="javascript:alert('WIP')">活动</a>
  40. </div>
  41. </div>
  42. {{else if .IsLandingPageHome}}
  43. <a class="item {{if .PageIsHome}}active{{end}}" href="/">{{.i18n.Tr "home"}}</a>
  44. <div class="ui dropdown item">
  45. 社区
  46. <i class="dropdown icon"></i>
  47. <div class="menu">
  48. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0228/17.html">欢迎加入OpenI</a>
  49. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">组织结构</a>
  50. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">启智开源许可证</a>
  51. <a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">OpenI社区章程</a>
  52. <a class="item" href="https://www.openi.org.cn/html/news/dongtai/">社区动态</a>
  53. </div>
  54. </div>
  55. <a class="item" href="{{AppSubUrl}}/explore/repos">项目</a>
  56. <div class="ui dropdown item">
  57. {{.i18n.Tr "explore"}}
  58. <i class="dropdown icon"></i>
  59. <div class="menu">
  60. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">更多开源项目</a>
  61. <a class="item" href="https://openi.org.cn/welcome/shixuns" target="_blank">学习</a>
  62. <a class="item" href="http://club.openi.org.cn/portal.php?mod=list&amp;catid=4" target="_blank">活动</a>
  63. </div>
  64. </div>
  65. {{else if .IsLandingPageExplore}}
  66. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "home"}}</a>
  67. {{else if .IsLandingPageOrganizations}}
  68. <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "home"}}</a>
  69. {{end}}
  70. {{template "custom/extra_links" .}}
  71. {{/*
  72. <div class="item">
  73. <div class="ui icon input">
  74. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  75. <i class="search icon"></i>
  76. </div>
  77. </div>
  78. */}}
  79. {{if .IsSigned}}
  80. <div class="right stackable menu">
  81. <a href="{{AppSubUrl}}/notifications" class="item poping up" data-content='{{.i18n.Tr "notifications"}}' data-variation="tiny inverted">
  82. <span class="text">
  83. <span class="fitted">{{svg "octicon-bell" 16}}</span>
  84. <span class="sr-mobile-only">{{.i18n.Tr "notifications"}}</span>
  85. {{$notificationUnreadCount := 0}}
  86. {{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
  87. <span class="ui red label {{if not $notificationUnreadCount}}hidden{{end}} notification_count">
  88. {{$notificationUnreadCount}}
  89. </span>
  90. </span>
  91. </a>
  92. <div class="ui dropdown jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  93. <span class="text">
  94. <span class="fitted">{{svg "octicon-plus" 16}}</span>
  95. <span class="sr-mobile-only">{{.i18n.Tr "create_new"}}</span>
  96. <span class="fitted not-mobile">{{svg "octicon-triangle-down" 16}}</span>
  97. </span>
  98. <div class="menu">
  99. <a class="item" href="{{AppSubUrl}}/repo/create">
  100. <span class="fitted">{{svg "octicon-plus" 16}}</span> {{.i18n.Tr "new_repo"}}
  101. </a>
  102. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  103. <span class="fitted">{{svg "octicon-repo-clone" 16}}</span> {{.i18n.Tr "new_migrate"}}
  104. </a>
  105. {{if .SignedUser.CanCreateOrganization}}
  106. <a class="item" href="{{AppSubUrl}}/org/create">
  107. <span class="fitted">{{svg "octicon-organization" 16}}</span> {{.i18n.Tr "new_org"}}
  108. </a>
  109. {{end}}
  110. </div><!-- end content create new menu -->
  111. </div><!-- end dropdown menu create new -->
  112. <div class="ui dropdown jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  113. <span class="text">
  114. <img class="ui tiny avatar image" width="24" height="24" src="{{.SignedUser.RelAvatarLink}}">
  115. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  116. <span class="mobile-only">{{.SignedUser.Name}}</span>
  117. <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down" 16}}</span>
  118. </span>
  119. <div class="menu user-menu" tabindex="-1">
  120. <div class="ui header">
  121. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  122. </div>
  123. <div class="divider"></div>
  124. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  125. {{svg "octicon-person" 16}}
  126. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  127. </a>
  128. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}?tab=stars">
  129. {{svg "octicon-star" 16}}
  130. {{.i18n.Tr "your_starred"}}
  131. </a>
  132. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  133. {{svg "octicon-settings" 16}}
  134. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  135. </a>
  136. <!--a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">
  137. {{svg "octicon-question" 16}}
  138. {{.i18n.Tr "help"}}<!-- Help -->
  139. </a-->
  140. {{if .IsAdmin}}
  141. <div class="divider"></div>
  142. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  143. <i class="icon settings"></i>
  144. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  145. </a>
  146. {{end}}
  147. <div class="divider"></div>
  148. <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
  149. {{svg "octicon-sign-out" 16}}
  150. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  151. </a>
  152. </div><!-- end content avatar menu -->
  153. </div><!-- end dropdown avatar menu -->
  154. </div><!-- end signed user right menu -->
  155. {{else}}
  156. <!--a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.i18n.Tr "help"}}</a-->
  157. <div class="right stackable menu">
  158. {{if .ShowRegistrationButton}}
  159. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  160. {{svg "octicon-person" 16}} {{.i18n.Tr "register"}}
  161. </a>
  162. {{end}}
  163. <a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  164. {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}}
  165. </a>
  166. </div><!-- end anonymous right menu -->
  167. {{end}}
  168. </div>