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

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