head.tmpl 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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.7.min.css">
  60. <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{MD5 AppVer}}">
  61. <!-- JavaScript -->
  62. <script src="{{AppSubUrl}}/js/semantic-2.2.7.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. </head>
  67. <body>
  68. <div class="full height">
  69. <noscript>Please enable JavaScript in your browser!</noscript>
  70. {{if not .PageIsInstall}}
  71. <div class="following bar light">
  72. <div class="ui container">
  73. <div class="ui grid">
  74. <div class="column">
  75. <div class="ui top secondary menu">
  76. <a class="item brand" href="{{AppSubUrl}}/">
  77. <img class="ui mini image" src="{{AppSubUrl}}/img/favicon.png">
  78. </a>
  79. {{if .IsSigned}}
  80. <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
  81. <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
  82. <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  83. {{else}}
  84. <a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
  85. {{end}}
  86. <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  87. {{/*<div class="item">
  88. <div class="ui icon input">
  89. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  90. <i class="search icon"></i>
  91. </div>
  92. </div>*/}}
  93. {{if .IsSigned}}
  94. <div class="right menu">
  95. <div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  96. <span class="text">
  97. <i class="octicon octicon-plus"><span class="sr-only">{{.i18n.Tr "create_new"}}</span></i>
  98. <i class="octicon octicon-triangle-down"></i>
  99. </span>
  100. <div class="menu">
  101. <a class="item" href="{{AppSubUrl}}/repo/create">
  102. <i class="octicon octicon-plus"></i> {{.i18n.Tr "new_repo"}}
  103. </a>
  104. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  105. <i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
  106. </a>
  107. {{if .SignedUser.CanCreateOrganization}}
  108. <a class="item" href="{{AppSubUrl}}/org/create">
  109. <i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
  110. </a>
  111. {{end}}
  112. </div><!-- end content create new menu -->
  113. </div><!-- end dropdown menu create new -->
  114. <div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  115. <span class="text avatar">
  116. <img class="ui small rounded image" src="{{.SignedUser.RelAvatarLink}}">
  117. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  118. <i class="octicon octicon-triangle-down" tabindex="-1"></i>
  119. </span>
  120. <div class="menu" tabindex="-1">
  121. <div class="ui header">
  122. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  123. </div>
  124. <div class="divider"></div>
  125. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  126. <i class="octicon octicon-person"></i>
  127. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  128. </a>
  129. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  130. <i class="octicon octicon-settings"></i>
  131. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  132. </a>
  133. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">
  134. <i class="octicon octicon-question"></i>
  135. {{.i18n.Tr "help"}}<!-- Help -->
  136. </a>
  137. {{if .IsAdmin}}
  138. <div class="divider"></div>
  139. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  140. <i class="icon settings"></i>
  141. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  142. </a>
  143. {{end}}
  144. <div class="divider"></div>
  145. <a class="item" href="{{AppSubUrl}}/user/logout">
  146. <i class="octicon octicon-sign-out"></i>
  147. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  148. </a>
  149. </div><!-- end content avatar menu -->
  150. </div><!-- end dropdown avatar menu -->
  151. </div><!-- end signed user right menu -->
  152. {{else}}
  153. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">{{.i18n.Tr "help"}}</a>
  154. <div class="right menu">
  155. {{if .ShowRegistrationButton}}
  156. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  157. <i class="octicon octicon-person"></i> {{.i18n.Tr "register"}}
  158. </a>
  159. {{end}}
  160. <a class="item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  161. <i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}
  162. </a>
  163. </div><!-- end anonymous right menu -->
  164. {{end}}
  165. </div><!-- end top menu -->
  166. </div><!-- end column -->
  167. </div><!-- end grid -->
  168. </div><!-- end container -->
  169. </div><!-- end bar -->
  170. {{end}}
  171. {{/*
  172. </div>
  173. </body>
  174. </html>
  175. */}}