1
0

head.tmpl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <!DOCTYPE html>
  2. <html>
  3. <head data-suburl="{{AppSubURL}}">
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  6. {{if not .PageIsAdmin}}
  7. <meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}Gogs{{end}}" />
  8. <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}Gogs is a painless self-hosted Git service{{end}}" />
  9. <meta name="keywords" content="go, git, self-hosted, gogs">
  10. {{end}}
  11. <meta name="referrer" content="no-referrer" />
  12. <meta name="_csrf" content="{{.CSRFToken}}" />
  13. <meta name="_suburl" content="{{AppSubURL}}" />
  14. <!-- Open Graph Tags -->
  15. {{if .PageIsAdmin}}
  16. {{else if .PageIsUserProfile}}
  17. <meta property="og:url" content="{{.Owner.HTMLURL}}" />
  18. <meta property="og:type" content="profile" />
  19. <meta property="og:title" content="{{.Owner.Name}}{{if .Owner.FullName}} ({{.Owner.FullName}}){{end}}">
  20. <meta property="og:description" content="{{.Owner.Name}} has {{.Owner.NumFollowers}} followers and is following {{.Owner.NumFollowing}} people.">
  21. <meta property="og:image" content="{{.Owner.AvatarURL}}" />
  22. {{else if .Repository}}
  23. <meta property="og:url" content="{{.Repository.HTMLURL}}" />
  24. <meta property="og:type" content="object" />
  25. <meta property="og:title" content="{{.Repository.FullName}}">
  26. <meta property="og:description" content="{{.Repository.Description}}">
  27. <meta property="og:image" content="{{.Repository.Owner.AvatarURL}}" />
  28. {{else}}
  29. <meta property="og:url" content="{{AppURL}}" />
  30. <meta property="og:type" content="website" />
  31. <meta property="og:title" content="{{AppName}}">
  32. <meta property="og:description" content="Gogs is a painless self-hosted Git service.">
  33. <meta property="og:image" content="{{AppURL}}img/favicon.png" />
  34. <meta property="og:site_name" content="Gogs">
  35. {{end}}
  36. <link rel="shortcut icon" href="{{AppSubURL}}/img/favicon.png" />
  37. <script src="{{AppSubURL}}/js/jquery-3.6.0.min.js"></script>
  38. <script src="{{AppSubURL}}/js/libs/jquery.are-you-sure.js"></script>
  39. <link rel="stylesheet" href="{{AppSubURL}}/assets/font-awesome-4.6.3/css/font-awesome.min.css">
  40. <link rel="stylesheet" href="{{AppSubURL}}/assets/octicons-4.3.0/octicons.min.css">
  41. <!-- notebook.js for rendering ipython notebooks and marked.js for rendering markdown in notebooks -->
  42. {{if .IsIPythonNotebook}}
  43. <script src="{{AppSubURL}}/plugins/notebookjs-0.4.2/notebook.min.js"></script>
  44. <script src="{{AppSubURL}}/plugins/marked-0.8.1/marked.min.js"></script>
  45. {{end}}
  46. {{if .RequireSimpleMDE}}
  47. <link rel="stylesheet" href="{{AppSubURL}}/plugins/simplemde-1.10.1/simplemde.min.css">
  48. <script src="{{AppSubURL}}/plugins/simplemde-1.10.1/simplemde.min.js"></script>
  49. <script src="{{AppSubURL}}/plugins/codemirror-5.17.0/addon/mode/loadmode.js"></script>
  50. <script src="{{AppSubURL}}/plugins/codemirror-5.17.0/mode/meta.js"></script>
  51. <script>
  52. CodeMirror.modeURL = "{{AppSubURL}}/plugins/codemirror-5.17.0/mode/%N/%N.js";
  53. </script>
  54. {{end}}
  55. <!-- Stylesheet -->
  56. <link rel="stylesheet" href="{{AppSubURL}}/css/semantic-2.4.2.min.css">
  57. <link rel="stylesheet" href="{{AppSubURL}}/css/gogs.min.css?v={{BuildCommit}}">
  58. <!-- SwayBien Stylesheet -->
  59. <style>
  60. @font-face {
  61. font-family: "Maple Mono NF CN";
  62. src: url("{{AppSubURL}}fonts/MapleMono-NF-CN-Medium.ttf") format("truetype");
  63. }
  64. </style>
  65. <link rel="stylesheet" href="{{AppSubURL}}/css/swaybien.css">
  66. <noscript>
  67. <style>
  68. .dropdown:hover > .menu { display: block; }
  69. .ui.secondary.menu .dropdown.item > .menu { margin-top: 0; }
  70. </style>
  71. </noscript>
  72. <!-- JavaScript -->
  73. <script src="{{AppSubURL}}/js/semantic-2.4.2.min.js"></script>
  74. <script src="{{AppSubURL}}/js/gogs.js?v={{BuildCommit}}"></script>
  75. <!-- SwayBien JavaScript -->
  76. <script src="{{AppSubURL}}/js/libs/darkmode-js-1.5.7.min.js"></script>
  77. <script src="{{AppSubURL}}/js/swaybien.js"></script>
  78. <title>{{if .Title}}{{.Title}} - {{end}}{{if eq .Lang "zh-CN"}}随变{{else if or (eq .Lang "zh-HK") (eq .Lang "zh-TW")}}隨變{{else}}{{AppName}}{{end}}</title>
  79. <meta name="theme-color" content="{{ThemeColorMetaTag}}">
  80. {{template "inject/head" .}}
  81. </head>
  82. <body>
  83. <div class="full height">
  84. <noscript>This website works better with JavaScript</noscript>
  85. {{if not .PageIsInstall}}
  86. <div class="following bar light">
  87. <div class="ui container">
  88. <div class="ui grid">
  89. <div class="column">
  90. <div class="ui top secondary menu">
  91. <a class="item brand" href="{{AppSubURL}}/">
  92. <img class="ui mini image" src="{{AppSubURL}}/img/favicon.png">
  93. </a>
  94. {{if .IsLogged}}
  95. <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubURL}}/">{{.i18n.Tr "dashboard"}}</a>
  96. <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubURL}}/issues">{{.i18n.Tr "issues"}}</a>
  97. <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubURL}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  98. {{else}}
  99. <a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubURL}}/">{{.i18n.Tr "home"}}</a>
  100. {{end}}
  101. <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubURL}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  102. {{/*<div class="item">
  103. <div class="ui icon input">
  104. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  105. <i class="search icon"></i>
  106. </div>
  107. </div>*/}}
  108. {{if .IsLogged}}
  109. <div class="right menu">
  110. <div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  111. <span class="text">
  112. <i class="octicon octicon-plus"><span class="sr-only">{{.i18n.Tr "create_new"}}</span></i>
  113. <i class="octicon octicon-triangle-down"></i>
  114. </span>
  115. <div class="menu">
  116. <a class="item" href="{{AppSubURL}}/repo/create">
  117. <i class="octicon octicon-plus"></i> {{.i18n.Tr "new_repo"}}
  118. </a>
  119. <a class="item" href="{{AppSubURL}}/repo/migrate">
  120. <i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
  121. </a>
  122. {{if .LoggedUser.CanCreateOrganization}}
  123. <a class="item" href="{{AppSubURL}}/org/create">
  124. <i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
  125. </a>
  126. {{end}}
  127. </div><!-- end content create new menu -->
  128. </div><!-- end dropdown menu create new -->
  129. <div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  130. <span class="text avatar">
  131. <img class="ui small rounded image" src="{{.LoggedUser.AvatarURLPath}}">
  132. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  133. <i class="octicon octicon-triangle-down" tabindex="-1"></i>
  134. </span>
  135. <div class="menu" tabindex="-1">
  136. <div class="ui header">
  137. {{.i18n.Tr "signed_in_as"}} <strong>{{.LoggedUser.Name}}</strong>
  138. </div>
  139. <div class="divider"></div>
  140. <a class="item" href="{{AppSubURL}}/{{.LoggedUser.Name}}">
  141. <i class="octicon octicon-person"></i> {{.i18n.Tr "your_profile"}}
  142. </a>
  143. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubURL}}/user/settings">
  144. <i class="octicon octicon-settings"></i> {{.i18n.Tr "your_settings"}}
  145. </a>
  146. <!-- SwayBien 深色模式切换按钮 -->
  147. <a class="swb-dark-btn item">
  148. <i class="octicon octicon-light-bulb"></i>
  149. {{if eq .Lang "zh-CN"}}切换深色模式
  150. {{else if or (eq .Lang "zh-HK") (eq .Lang "zh-TW")}}切換深色模式
  151. {{else if eq .Lang "de-DE"}}Dunkelmodus umschalten
  152. {{else if eq .Lang "fr-FR"}}Basculer le mode sombre
  153. {{else if eq .Lang "nl-NL"}}Donkere modus in-/uitschakelen
  154. {{else if eq .Lang "lv-LV"}}Pārslēgt tumšo režīmu
  155. {{else if eq .Lang "ru-RU"}}Переключить тёмный режим
  156. {{else if eq .Lang "ja-JP"}}ダークモードに切り替え
  157. {{else if eq .Lang "es-ES"}}Cambiar a modo oscuro
  158. {{else if eq .Lang "pt-BR"}}Alternar modo escuro
  159. {{else if eq .Lang "pl-PL"}}Przełącz tryb ciemny
  160. {{else if eq .Lang "bg-BG"}}Превключване на тъмен режим
  161. {{else if eq .Lang "it-IT"}}Attiva/disattiva modalità scura
  162. {{else if eq .Lang "fi-FI"}}Vaihda tummaan tila
  163. {{else if eq .Lang "tr-TR"}}Karanlık modu değiştir
  164. {{else if eq .Lang "cs-CZ"}}Přepnout tmavý režim
  165. {{else if eq .Lang "sr-SP"}}Промени тамни мод
  166. {{else if eq .Lang "sv-SE"}}Växla mörkt läge
  167. {{else if eq .Lang "ko-KR"}}다크 모드 전환
  168. {{else if eq .Lang "gl-ES"}}Cambiar a modo escuro
  169. {{else if eq .Lang "uk-UA"}}Перемкнути темний режим
  170. {{else if eq .Lang "en-GB"}}Toggle dark mode
  171. {{else if eq .Lang "hu-HU"}}Sötét mód váltása
  172. {{else if eq .Lang "sk-SK"}}Prepnúť tmavý režim
  173. {{else if eq .Lang "id-ID"}}Aktifkan mode gelap
  174. {{else if eq .Lang "fa-IR"}}تغییر حالت تاریک
  175. {{else if eq .Lang "vi-VN"}}Chuyển đổi chế độ tối
  176. {{else if eq .Lang "pt-PT"}}Alternar modo escuro
  177. {{else if eq .Lang "mn-MN"}}Хар режимд шилжих
  178. {{else if eq .Lang "ro-RO"}}Comută modul întunecat
  179. {{else}}Toggle dark mode{{end}}
  180. </a>
  181. <a class="item" target="_blank" rel="noopener noreferrer" href="https://gogs.io/docs" rel="noreferrer">
  182. <i class="octicon octicon-question"></i> {{.i18n.Tr "help"}}
  183. </a>
  184. {{if .IsAdmin}}
  185. <div class="divider"></div>
  186. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubURL}}/admin">
  187. <i class="icon settings"></i> {{.i18n.Tr "admin_panel"}}
  188. </a>
  189. {{end}}
  190. <div class="divider"></div>
  191. <form id="logout-form" class="item" action="{{AppSubURL}}/user/logout" method="POST">
  192. {{.CSRFTokenHTML}}
  193. <div class="submit-button" data-form="#logout-form">
  194. <i class="octicon octicon-sign-out"></i> {{.i18n.Tr "sign_out"}}
  195. </div>
  196. </form>
  197. </div><!-- end content avatar menu -->
  198. </div><!-- end dropdown avatar menu -->
  199. </div><!-- end signed user right menu -->
  200. {{else}}
  201. <a class="item" target="_blank" rel="noopener noreferrer" href="https://gogs.io/docs" rel="noreferrer">{{.i18n.Tr "help"}}</a>
  202. <div class="right menu">
  203. {{if .ShowRegistrationButton}}
  204. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubURL}}/user/sign_up">
  205. <i class="octicon octicon-person"></i> {{.i18n.Tr "register"}}
  206. </a>
  207. {{end}}
  208. <a class="item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubURL}}/user/login?redirect_to={{.Link}}">
  209. <i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}
  210. </a>
  211. <!-- SwayBien 随变立刻同步镜像仓库按钮 -->
  212. {{if and .IsRepositoryAdmin .Repository.IsMirror}}
  213. <a class="swb-sync-btn item" data-repo="{{AppSubURL}}/{{.Repository.Owner.Name}}/{{.Repository.Name}}/settings">
  214. <i class="octicon octicon-sync"></i> {{$.i18n.Tr "repo.settings.sync_mirror"}} {{.Repository.Name}}
  215. <swb-hide>{{.CSRFTokenHTML}}</swb-hide>
  216. </a>
  217. {{end}}
  218. <!-- SwayBien 随变深色模式切换按钮 -->
  219. <a class="swb-dark-btn item">
  220. <i class="octicon octicon-light-bulb"></i> {{if eq .Lang "zh-CN"}}切换深色模式
  221. {{else if or (eq .Lang "zh-HK") (eq .Lang "zh-TW")}}切換深色模式
  222. {{else if eq .Lang "de-DE"}}Dunkelmodus umschalten
  223. {{else if eq .Lang "fr-FR"}}Basculer le mode sombre
  224. {{else if eq .Lang "nl-NL"}}Donkere modus in-/uitschakelen
  225. {{else if eq .Lang "lv-LV"}}Pārslēgt tumšo režīmu
  226. {{else if eq .Lang "ru-RU"}}Переключить тёмный режим
  227. {{else if eq .Lang "ja-JP"}}ダークモードに切り替え
  228. {{else if eq .Lang "es-ES"}}Cambiar a modo oscuro
  229. {{else if eq .Lang "pt-BR"}}Alternar modo escuro
  230. {{else if eq .Lang "pl-PL"}}Przełącz tryb ciemny
  231. {{else if eq .Lang "bg-BG"}}Превключване на тъмен режим
  232. {{else if eq .Lang "it-IT"}}Attiva/disattiva modalità scura
  233. {{else if eq .Lang "fi-FI"}}Vaihda tummaan tila
  234. {{else if eq .Lang "tr-TR"}}Karanlık modu değiştir
  235. {{else if eq .Lang "cs-CZ"}}Přepnout tmavý režim
  236. {{else if eq .Lang "sr-SP"}}Промени тамни мод
  237. {{else if eq .Lang "sv-SE"}}Växla mörkt läge
  238. {{else if eq .Lang "ko-KR"}}다크 모드 전환
  239. {{else if eq .Lang "gl-ES"}}Cambiar a modo escuro
  240. {{else if eq .Lang "uk-UA"}}Перемкнути темний режим
  241. {{else if eq .Lang "en-GB"}}Toggle dark mode
  242. {{else if eq .Lang "hu-HU"}}Sötét mód váltása
  243. {{else if eq .Lang "sk-SK"}}Prepnúť tmavý režim
  244. {{else if eq .Lang "id-ID"}}Aktifkan mode gelap
  245. {{else if eq .Lang "fa-IR"}}تغییر حالت تاریک
  246. {{else if eq .Lang "vi-VN"}}Chuyển đổi chế độ tối
  247. {{else if eq .Lang "pt-PT"}}Alternar modo escuro
  248. {{else if eq .Lang "mn-MN"}}Хар режимд шилжих
  249. {{else if eq .Lang "ro-RO"}}Comută modul întunecat
  250. {{else}}Toggle dark mode{{end}}
  251. </a>
  252. </div><!-- end anonymous right menu -->
  253. {{end}}
  254. </div><!-- end top menu -->
  255. </div><!-- end column -->
  256. </div><!-- end grid -->
  257. </div><!-- end container -->
  258. </div><!-- end bar -->
  259. {{end}}
  260. {{if .ServerNotice}}
  261. <div class="ui container grid warning message">
  262. <div class="content">
  263. {{.ServerNotice | Str2HTML}}
  264. </div>
  265. </div>
  266. {{end}}
  267. {{/*
  268. </div>
  269. </body>
  270. </html>
  271. */}}