head.tmpl 9.5 KB

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