head.tmpl 8.8 KB

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