head.tmpl 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. <meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}Gogs{{end}}" />
  7. <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}Gogs is a painless self-hosted Git service{{end}}" />
  8. <meta name="keywords" content="go, git, self-hosted, gogs">
  9. <meta name="referrer" content="no-referrer" />
  10. <meta name="_csrf" content="{{.CsrfToken}}" />
  11. <meta name="_suburl" content="{{AppSubUrl}}" />
  12. {{if .GoGetImport}}
  13. <meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">
  14. <meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
  15. {{end}}
  16. <!-- Open Graph Tags -->
  17. {{if .PageIsUserProfile}}
  18. <meta property="og:url" content="{{.Owner.HTMLURL}}" />
  19. <meta property="og:type" content="profile" />
  20. <meta property="og:title" content="{{.Owner.Name}}{{if .Owner.FullName}} ({{.Owner.FullName}}){{end}}">
  21. <meta property="og:description" content="{{.Owner.Name}} has {{.Owner.NumFollowers}} followers and is following {{.Owner.NumFollowing}} people.">
  22. <meta property="og:image" content="{{.Owner.AvatarLink}}" />
  23. {{else if .Repository}}
  24. <meta property="og:url" content="{{.Repository.HTMLURL}}" />
  25. <meta property="og:type" content="object" />
  26. <meta property="og:title" content="{{.Repository.FullName}}">
  27. <meta property="og:description" content="{{.Repository.Description}}">
  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 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.2.6/notebook.min.js"></script>
  44. <script src="{{AppSubUrl}}/plugins/marked-0.3.6/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.2.7.min.css">
  57. <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{MD5 AppVer}}">
  58. <!-- JavaScript -->
  59. <script src="{{AppSubUrl}}/js/semantic-2.2.7.min.js"></script>
  60. <script src="{{AppSubUrl}}/js/gogs.js?v={{MD5 AppVer}}"></script>
  61. <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
  62. <meta name="theme-color" content="{{ThemeColorMetaTag}}">
  63. </head>
  64. <body>
  65. <div class="full height">
  66. <noscript>Please enable JavaScript in your browser!</noscript>
  67. {{if not .PageIsInstall}}
  68. <div class="following bar light">
  69. <div class="ui container">
  70. <div class="ui grid">
  71. <div class="column">
  72. <div class="ui top secondary menu">
  73. <a class="item brand" href="{{AppSubUrl}}/">
  74. <img class="ui mini image" src="{{AppSubUrl}}/img/favicon.png">
  75. </a>
  76. {{if .IsSigned}}
  77. <a class="item{{if .PageIsDashboard}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
  78. <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
  79. <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
  80. {{else}}
  81. <a class="item{{if .PageIsHome}} active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a>
  82. {{end}}
  83. <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
  84. {{/*<div class="item">
  85. <div class="ui icon input">
  86. <input class="searchbox" type="text" placeholder="{{.i18n.Tr "search_project"}}">
  87. <i class="search icon"></i>
  88. </div>
  89. </div>*/}}
  90. {{if .IsSigned}}
  91. <div class="right menu">
  92. <div class="ui dropdown head link jump item poping up" data-content="{{.i18n.Tr "create_new"}}" data-variation="tiny inverted">
  93. <span class="text">
  94. <i class="octicon octicon-plus"><span class="sr-only">{{.i18n.Tr "create_new"}}</span></i>
  95. <i class="octicon octicon-triangle-down"></i>
  96. </span>
  97. <div class="menu">
  98. <a class="item" href="{{AppSubUrl}}/repo/create">
  99. <i class="octicon octicon-plus"></i> {{.i18n.Tr "new_repo"}}
  100. </a>
  101. <a class="item" href="{{AppSubUrl}}/repo/migrate">
  102. <i class="octicon octicon-repo-clone"></i> {{.i18n.Tr "new_migrate"}}
  103. </a>
  104. {{if .SignedUser.CanCreateOrganization}}
  105. <a class="item" href="{{AppSubUrl}}/org/create">
  106. <i class="octicon octicon-organization"></i> {{.i18n.Tr "new_org"}}
  107. </a>
  108. {{end}}
  109. </div><!-- end content create new menu -->
  110. </div><!-- end dropdown menu create new -->
  111. <div class="ui dropdown head link jump item poping up" tabindex="-1" data-content="{{.i18n.Tr "user_profile_and_more"}}" data-variation="tiny inverted">
  112. <span class="text avatar">
  113. <img class="ui small rounded image" src="{{.SignedUser.RelAvatarLink}}">
  114. <span class="sr-only">{{.i18n.Tr "user_profile_and_more"}}</span>
  115. <i class="octicon octicon-triangle-down" tabindex="-1"></i>
  116. </span>
  117. <div class="menu" tabindex="-1">
  118. <div class="ui header">
  119. {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
  120. </div>
  121. <div class="divider"></div>
  122. <a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}">
  123. <i class="octicon octicon-person"></i>
  124. {{.i18n.Tr "your_profile"}}<!-- Your profile -->
  125. </a>
  126. <a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings">
  127. <i class="octicon octicon-settings"></i>
  128. {{.i18n.Tr "your_settings"}}<!-- Your settings -->
  129. </a>
  130. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">
  131. <i class="octicon octicon-question"></i>
  132. {{.i18n.Tr "help"}}<!-- Help -->
  133. </a>
  134. {{if .IsAdmin}}
  135. <div class="divider"></div>
  136. <a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin">
  137. <i class="icon settings"></i>
  138. {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
  139. </a>
  140. {{end}}
  141. <div class="divider"></div>
  142. <a class="item" href="{{AppSubUrl}}/user/logout">
  143. <i class="octicon octicon-sign-out"></i>
  144. {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
  145. </a>
  146. </div><!-- end content avatar menu -->
  147. </div><!-- end dropdown avatar menu -->
  148. </div><!-- end signed user right menu -->
  149. {{else}}
  150. <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">{{.i18n.Tr "help"}}</a>
  151. <div class="right menu">
  152. {{if .ShowRegistrationButton}}
  153. <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
  154. <i class="octicon octicon-person"></i> {{.i18n.Tr "register"}}
  155. </a>
  156. {{end}}
  157. <a class="item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubUrl}}/user/login?redirect_to={{.Link}}">
  158. <i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}
  159. </a>
  160. </div><!-- end anonymous right menu -->
  161. {{end}}
  162. </div><!-- end top menu -->
  163. </div><!-- end column -->
  164. </div><!-- end grid -->
  165. </div><!-- end container -->
  166. </div><!-- end bar -->
  167. {{end}}
  168. {{/*
  169. </div>
  170. </body>
  171. </html>
  172. */}}