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 5.9KB

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