head.tmpl 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. {{if .GoGetImport}}
  15. <meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
  16. <meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
  17. {{end}}
  18. <!-- Open Graph Tags -->
  19. {{if .PageIsAdmin}}
  20. {{else if .PageIsUserProfile}}
  21. <meta property="og:url" content="{{.Owner.HTMLURL}}" />
  22. <meta property="og:type" content="profile" />
  23. <meta property="og:title" content="{{.Owner.Name}}{{if .Owner.FullName}} ({{.Owner.FullName}}){{end}}">
  24. <meta property="og:description" content="{{.Owner.Name}} has {{.Owner.NumFollowers}} followers and is following {{.Owner.NumFollowing}} people.">
  25. <meta property="og:image" content="{{.Owner.AvatarLink}}" />
  26. {{else if .Repository}}
  27. <meta property="og:url" content="{{.Repository.HTMLURL}}" />
  28. <meta property="og:type" content="object" />
  29. <meta property="og:title" content="{{.Repository.FullName}}">
  30. <meta property="og:description" content="{{.Repository.Description}}">
  31. {{else}}
  32. <meta property="og:url" content="{{AppUrl}}" />
  33. <meta property="og:type" content="website" />
  34. <meta property="og:title" content="{{AppName}}">
  35. <meta property="og:description" content="Gogs is a painless self-hosted Git service.">
  36. <meta property="og:image" content="{{AppUrl}}img/gogs-lg.png" />
  37. <meta property="og:site_name" content="Gogs">
  38. {{end}}
  39. <link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
  40. <script src="{{AppSubUrl}}/js/jquery-1.11.3.min.js"></script>
  41. <script src="{{AppSubUrl}}/js/libs/jquery.are-you-sure.js"></script>
  42. <link rel="stylesheet" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css">
  43. <link rel="stylesheet" href="{{AppSubUrl}}/assets/octicons-4.3.0/octicons.min.css">
  44. <!-- notebook.js for rendering ipython notebooks and marked.js for rendering markdown in notebooks -->
  45. {{if .IsIPythonNotebook }}
  46. <script src="{{AppSubUrl}}/plugins/notebookjs-0.2.6/notebook.min.js"></script>
  47. <script src="{{AppSubUrl}}/plugins/marked-0.3.6/marked.min.js"></script>
  48. {{end}}
  49. {{if .RequireSimpleMDE}}
  50. <link rel="stylesheet" href="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.css">
  51. <script src="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.js"></script>
  52. <script src="{{AppSubUrl}}/plugins/codemirror-5.17.0/addon/mode/loadmode.js"></script>
  53. <script src="{{AppSubUrl}}/plugins/codemirror-5.17.0/mode/meta.js"></script>
  54. <script>
  55. CodeMirror.modeURL = "{{AppSubUrl}}/plugins/codemirror-5.17.0/mode/%N/%N.js";
  56. </script>
  57. {{end}}
  58. <!-- Stylesheet -->
  59. <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic-2.2.9.min.css">
  60. <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{MD5 AppVer}}">
  61. <!-- JavaScript -->
  62. <script src="{{AppSubUrl}}/js/semantic-2.2.9.min.js"></script>
  63. <script src="{{AppSubUrl}}/js/gogs.js?v={{MD5 AppVer}}"></script>
  64. <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
  65. <meta name="theme-color" content="{{ThemeColorMetaTag}}">
  66. {{template "inject/head" .}}
  67. </head>
  68. <body>
  69. <div class="full height">
  70. <noscript>Please enable JavaScript in your browser!</noscript>
  71. {{if not .PageIsInstall}}
  72. <div class="following bar light">
  73. <div class="ui container">
  74. <div class="ui grid">
  75. <div class="column">
  76. <div class="ui top secondary menu">
  77. <a class="item brand" href="{{AppSubUrl}}/">
  78. <img class="ui mini image" src="{{AppSubUrl}}/img/favicon.png">
  79. </a>
  80. {{if .IsSigned}}
  81. <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
  82. <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
  83. <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  84. {{else}}
  85. <a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
  86. {{end}}
  87. <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  88. {{/*<div class="item">
  89. <div class="ui icon input">
  90. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  91. <i class="search icon"></i>
  92. </div>
  93. </div>*/}}
  94. {{if .IsSigned}}
  95. <div class="right menu">
  96. <div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  97. <span class="text">
  98. <i class="octicon octicon-plus"><span class="sr-only">{{.i18n.Tr "create_new"}}</span></i>
  99. <i class="octicon octicon-triangle-down"></i>
  100. </span>
  101. <div class="menu">
  102. <a class="item" href="{{AppSubUrl}}/repo/create">
  103. <i class="octicon octicon-plus"></i> {{.i18n.Tr "new_repo"}}
  104. </a>
  105. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  106. <i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
  107. </a>
  108. {{if .SignedUser.CanCreateOrganization}}
  109. <a class="item" href="{{AppSubUrl}}/org/create">
  110. <i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
  111. </a>
  112. {{end}}
  113. </div><!-- end content create new menu -->
  114. </div><!-- end dropdown menu create new -->
  115. <div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  116. <span class="text avatar">
  117. <img class="ui small rounded image" src="{{.SignedUser.RelAvatarLink}}">
  118. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  119. <i class="octicon octicon-triangle-down" tabindex="-1"></i>
  120. </span>
  121. <div class="menu" tabindex="-1">
  122. <div class="ui header">
  123. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  124. </div>
  125. <div class="divider"></div>
  126. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  127. <i class="octicon octicon-person"></i>
  128. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  129. </a>
  130. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  131. <i class="octicon octicon-settings"></i>
  132. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  133. </a>
  134. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">
  135. <i class="octicon octicon-question"></i>
  136. {{.i18n.Tr "help"}}<!-- Help -->
  137. </a>
  138. {{if .IsAdmin}}
  139. <div class="divider"></div>
  140. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  141. <i class="icon settings"></i>
  142. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  143. </a>
  144. {{end}}
  145. <div class="divider"></div>
  146. <a class="item" href="{{AppSubUrl}}/user/logout">
  147. <i class="octicon octicon-sign-out"></i>
  148. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  149. </a>
  150. </div><!-- end content avatar menu -->
  151. </div><!-- end dropdown avatar menu -->
  152. </div><!-- end signed user right menu -->
  153. {{else}}
  154. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">{{.i18n.Tr "help"}}</a>
  155. <div class="right menu">
  156. {{if .ShowRegistrationButton}}
  157. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  158. <i class="octicon octicon-person"></i> {{.i18n.Tr "register"}}
  159. </a>
  160. {{end}}
  161. <a class="item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  162. <i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}
  163. </a>
  164. </div><!-- end anonymous right menu -->
  165. {{end}}
  166. </div><!-- end top menu -->
  167. </div><!-- end column -->
  168. </div><!-- end grid -->
  169. </div><!-- end container -->
  170. </div><!-- end bar -->
  171. {{end}}
  172. {{/*
  173. </div>
  174. </body>
  175. </html>
  176. */}}