my-gitea-templates/templates/base/ head.tmpl
280 lines
12 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head data-suburl="{{AppSubUrl}}">
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta http-equiv="x-ua-compatible" content="ie=edge">
  7. <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
  8. <meta name="theme-color" content="{{ThemeColorMetaTag}}">
  9. <meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}" />
  10. <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}" />
  11. <meta name="keywords" content="{{MetaKeywords}}">
  12. <meta name="referrer" content="no-referrer" />
  13. <meta name="_csrf" content="{{.CsrfToken}}" />
  14. <meta name="_suburl" content="{{AppSubUrl}}" />
  15. {{if .IsSigned}}
  16. <meta name="_uid" content="{{.SignedUser.ID}}" />
  17. {{end}}
  18. {{if .ContextUser}}
  19. <meta name="_context_uid" content="{{.ContextUser.ID}}" />
  20. {{end}}
  21. {{if .SearchLimit}}
  22. <meta name="_search_limit" content="{{.SearchLimit}}" />
  23. {{end}}
  24. {{if .GoGetImport}}
  25. <meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
  26. <meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
  27. {{end}}
  28. <script>
  29. {{SafeJS `/*
  30. @licstart The following is the entire license notice for the
  31. JavaScript code in this page.
  32. Copyright (c) 2016 The Gitea Authors
  33. Copyright (c) 2015 The Gogs Authors
  34. Permission is hereby granted, free of charge, to any person obtaining a copy
  35. of this software and associated documentation files (the "Software"), to deal
  36. in the Software without restriction, including without limitation the rights
  37. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  38. copies of the Software, and to permit persons to whom the Software is
  39. furnished to do so, subject to the following conditions:
  40. The above copyright notice and this permission notice shall be included in
  41. all copies or substantial portions of the Software.
  42. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  43. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  44. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  45. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  46. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  47. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  48. THE SOFTWARE.
  49. ---
  50. Licensing information for additional javascript libraries can be found at:
  51. {{AppSubUrl}}/vendor/librejs.html
  52. @licend The above is the entire license notice
  53. for the JavaScript code in this page.
  54. */`}}
  55. </script>
  56. <link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
  57. <link rel="mask-icon" href="{{AppSubUrl}}/img/gitea-safari.svg" color="#609926">
  58. <link rel="preload" href="{{AppSubUrl}}/vendor/assets/font-awesome/css/font-awesome.min.css" as="style" onload="this.rel='stylesheet'">
  59. <noscript><link rel="stylesheet" href="{{AppSubUrl}}/vendor/assets/font-awesome/css/font-awesome.min.css"></noscript>
  60. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/assets/octicons/octicons.min.css">
  61. {{if .RequireSimpleMDE}}
  62. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/simplemde/simplemde.min.css">
  63. {{end}}
  64. {{if .RequireGitGraph}}
  65. <!-- graph -->
  66. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/gitgraph/gitgraph.css">
  67. {{end}}
  68. {{if .RequireTribute}}
  69. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/tribute/tribute.css">
  70. {{end}}
  71. <!-- Stylesheet -->
  72. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.css">
  73. <link rel="stylesheet" href="{{AppSubUrl}}/css/index.css?v={{MD5 AppVer}}">
  74. <noscript>
  75. <style>
  76. .dropdown:hover > .menu { display: block; }
  77. .ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
  78. </style>
  79. </noscript>
  80. {{if .RequireHighlightJS}}
  81. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/highlight/github.css">
  82. {{end}}
  83. {{if .RequireMinicolors}}
  84. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css">
  85. {{end}}
  86. {{if .RequireDatetimepicker}}
  87. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css">
  88. {{end}}
  89. {{if .RequireDropzone}}
  90. <link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css">
  91. {{end}}
  92. <style class="list-search-style"></style>
  93. <script src="{{AppSubUrl}}/vendor/plugins/cssrelpreload/loadCSS.min.js"></script>
  94. <script src="{{AppSubUrl}}/vendor/plugins/cssrelpreload/cssrelpreload.min.js"></script>
  95. {{if .PageIsUserProfile}}
  96. <meta property="og:title" content="{{.Owner.Name}}" />
  97. <meta property="og:type" content="profile" />
  98. <meta property="og:image" content="{{.Owner.AvatarLink}}" />
  99. <meta property="og:url" content="{{.Owner.HTMLURL}}" />
  100. <meta property="og:site_name" content="{{AppName}}" />
  101. {{else if .Repository}}
  102. <meta property="og:title" content="{{.Repository.Name}}" />
  103. <meta property="og:type" content="object" />
  104. <meta property="og:image" content="{{.Repository.Owner.AvatarLink}}" />
  105. <meta property="og:url" content="{{.Repository.HTMLURL}}" />
  106. {{if .Repository.Description}}
  107. <meta property="og:description" content="{{.Repository.Description}}" />
  108. {{end}}
  109. <meta property="og:site_name" content="{{AppName}}" />
  110. {{else}}
  111. <meta property="og:title" content="{{AppName}}">
  112. <meta property="og:type" content="website" />
  113. <meta property="og:image" content="{{AppSubUrl}}/img/gitea-lg.png" />
  114. <meta property="og:url" content="{{AppUrl}}" />
  115. <meta property="og:description" content="{{MetaDescription}}">
  116. {{end}}
  117. {{template "custom/header" .}}
  118. </head>
  119. <body>
  120. {{template "custom/body_outer_pre" .}}
  121. <div class="full height">
  122. <noscript>{{.i18n.Tr "enable_javascript"}}</noscript>
  123. {{template "custom/body_inner_pre" .}}
  124. {{if not .PageIsInstall}}
  125. <div class="ui top secondary stackable main menu following bar light">
  126. <div class="ui container" id="navbar">
  127. <div class="item brand" style="justify-content: space-between;">
  128. <a href="{{AppSubUrl}}/" href="{{AppSubUrl}}/">
  129. <img class="ui mini image" src="{{AppSubUrl}}/img/gitea-sm.png">
  130. </a>
  131. <div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
  132. <i class="sidebar icon"></i>
  133. </div>
  134. </div>
  135. {{if .IsSigned}}
  136. <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
  137. <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
  138. <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  139. {{else}}
  140. <a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
  141. {{end}}
  142. <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  143. {{template "custom/extra_links" .}}
  144. {{/*
  145. <div class="item">
  146. <div class="ui icon input">
  147. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  148. <i class="search icon"></i>
  149. </div>
  150. </div>
  151. */}}
  152. {{if .IsSigned}}
  153. <div class="right stackable menu">
  154. <a href="{{AppSubUrl}}/notifications" class="item poping up" data-content='{{.i18n.Tr "notifications"}}' data-variation="tiny inverted">
  155. <span class="text">
  156. <i class="fitted octicon octicon-inbox"></i>
  157. <span class="sr-mobile-only">{{.i18n.Tr "notifications"}}</span>
  158. {{if .NotificationUnreadCount}}
  159. <span class="ui red label">
  160. {{.NotificationUnreadCount}}
  161. </span>
  162. {{end}}
  163. </span>
  164. </a>
  165. <div class="ui dropdown jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  166. <span class="text">
  167. <i class="fitted octicon octicon-plus"></i>
  168. <span class="sr-mobile-only">{{.i18n.Tr "create_new"}}</span>
  169. <i class="fitted octicon octicon-triangle-down not-mobile"></i>
  170. </span>
  171. <div class="menu">
  172. <a class="item" href="{{AppSubUrl}}/repo/create">
  173. <i class="fitted octicon octicon-plus"></i> {{.i18n.Tr "new_repo"}}
  174. </a>
  175. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  176. <i class="fitted octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
  177. </a>
  178. {{if .SignedUser.CanCreateOrganization}}
  179. <a class="item" href="{{AppSubUrl}}/org/create">
  180. <i class="fitted octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
  181. </a>
  182. {{end}}
  183. </div><!-- end content create new menu -->
  184. </div><!-- end dropdown menu create new -->
  185. <div class="ui dropdown jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  186. <span class="text">
  187. <img class="ui tiny avatar image" src="{{.SignedUser.RelAvatarLink}}">
  188. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  189. <span class="mobile-only">{{.SignedUser.Name}}</span>
  190. <i class="fitted octicon octicon-triangle-down not-mobile" tabindex="-1"></i>
  191. </span>
  192. <div class="menu" tabindex="-1">
  193. <div class="ui header">
  194. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  195. </div>
  196. <div class="divider"></div>
  197. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  198. <i class="octicon octicon-person"></i>
  199. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  200. </a>
  201. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}?tab=stars">
  202. <i class="octicon octicon-star"></i>
  203. {{.i18n.Tr "your_starred"}}
  204. </a>
  205. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  206. <i class="octicon octicon-settings"></i>
  207. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  208. </a>
  209. <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">
  210. <i class="octicon octicon-question"></i>
  211. {{.i18n.Tr "help"}}<!-- Help -->
  212. </a>
  213. {{if .IsAdmin}}
  214. <div class="divider"></div>
  215. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  216. <i class="icon settings"></i>
  217. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  218. </a>
  219. {{end}}
  220. <div class="divider"></div>
  221. <a class="item" href="{{AppSubUrl}}/user/logout">
  222. <i class="octicon octicon-sign-out"></i>
  223. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  224. </a>
  225. </div><!-- end content avatar menu -->
  226. </div><!-- end dropdown avatar menu -->
  227. </div><!-- end signed user right menu -->
  228. {{else}}
  229. <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.i18n.Tr "help"}}</a>
  230. <div class="right stackable menu">
  231. {{if .ShowRegistrationButton}}
  232. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  233. <i class="octicon octicon-person"></i> {{.i18n.Tr "register"}}
  234. </a>
  235. {{end}}
  236. <a class="item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  237. <i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}
  238. </a>
  239. </div><!-- end anonymous right menu -->
  240. {{end}}
  241. </div><!-- end container -->
  242. </div><!-- end bar -->
  243. {{end}}
  244. {{/*
  245. </div>
  246. </body>
  247. </html>
  248. */}}