Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

home.tmpl 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {{template "base/head" .}}
  2. <div class="repository file list">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <div class="ui repo-description">
  7. <div id="repo-desc">
  8. {{if .Repository.DescriptionHTML}}<span class="description has-emoji">{{.Repository.DescriptionHTML}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
  9. <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
  10. </div>
  11. {{if .RepoSearchEnabled}}
  12. <div class="ui repo-search">
  13. <form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get">
  14. <div class="field">
  15. <div class="ui action input">
  16. <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.search.search_repo"}}">
  17. <button class="ui icon button" type="submit">
  18. <i class="search icon"></i>
  19. </button>
  20. </div>
  21. </div>
  22. </form>
  23. </div>
  24. {{end}}
  25. </div>
  26. <div class="ui repo-topic" id="repo-topic">
  27. {{range .Topics}}<a class="ui green basic label topic" style="cursor:pointer;" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}}
  28. {{if .IsRepositoryAdmin}}<a id="manage_topic" style="cursor:pointer;margin-left:10px;">{{.i18n.Tr "repo.topic.manage_topics"}}</a>{{end}}
  29. </div>
  30. {{if .IsRepositoryAdmin}}
  31. <div class="ui repo-topic-edit grid form segment error" id="topic_edit" style="display:none">
  32. <div class="fourteen wide column">
  33. <div class="field">
  34. <div class="ui fluid multiple search selection dropdown">
  35. <input type="hidden" name="topics" value="{{range $i, $v := .Topics}}{{.Name}}{{if lt (Add $i 1) (len $.Topics)}},{{end}}{{end}}">
  36. {{range .Topics}}
  37. <div class="ui green basic label topic transition visible" data-value="{{.Name}}" style="display: inline-block !important; cursor: default;">{{.Name}}<i class="delete icon"></i></div>
  38. {{end}}
  39. <div class="text"></div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class="two wide column">
  44. <a class="ui compact button primary" href="javascript:;" id="save_topic"
  45. data-link="{{.RepoLink}}/topics">{{.i18n.Tr "repo.topic.done"}}</a>
  46. </div>
  47. </div>
  48. {{end}}
  49. <div class="hide" id="validate_prompt">
  50. <span id="count_prompt">{{.i18n.Tr "repo.topic.count_prompt"}}</span>
  51. <span id="format_prompt">{{.i18n.Tr "repo.topic.format_prompt"}}</span>
  52. </div>
  53. {{template "repo/sub_menu" .}}
  54. <div class="ui stackable secondary menu mobile--margin-between-items mobile--no-negative-margins">
  55. {{if and .PullRequestCtx.Allowed .IsViewBranch}}
  56. <div class="fitted item">
  57. <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{.Repository.Owner.Name}}:{{.BranchName | EscapePound}}">
  58. <button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
  59. </a>
  60. </div>
  61. {{end}}
  62. {{template "repo/branch_dropdown" .}}
  63. {{ $n := len .TreeNames}}
  64. {{ $l := Subtract $n 1}}
  65. <div class="fitted item"><span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div>
  66. <div class="right fitted item" id="file-buttons">
  67. <div class="ui tiny blue buttons">
  68. {{if .Repository.CanEnableEditor}}
  69. {{if .CanAddFile}}
  70. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  71. {{.i18n.Tr "repo.editor.new_file"}}
  72. </a>
  73. {{end}}
  74. {{if .CanUploadFile}}
  75. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  76. {{.i18n.Tr "repo.editor.upload_file"}}
  77. </a>
  78. {{end}}
  79. {{end}}
  80. {{if and (ne $n 0) (not .IsViewFile)}}
  81. <a href="{{.RepoLink}}/commits/{{EscapePound .BranchNameSubURL}}/{{EscapePound .TreePath}}" class="ui button">
  82. {{.i18n.Tr "repo.file_history"}}
  83. </a>
  84. {{end}}
  85. </div>
  86. </div>
  87. <div class="fitted item">
  88. <!-- Only show clone panel in repository home page -->
  89. {{if eq $n 0}}
  90. <div class="ui action tiny input" id="clone-panel">
  91. {{if not $.DisableHTTP}}
  92. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  93. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  94. </button>
  95. {{end}}
  96. {{if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
  97. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  98. SSH
  99. </button>
  100. {{end}}
  101. {{if not $.DisableHTTP}}
  102. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  103. {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
  104. <input id="repo-clone-url" value="{{$.CloneLink.SSH}}" readonly>
  105. {{end}}
  106. {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
  107. <button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
  108. <i class="octicon octicon-clippy"></i>
  109. </button>
  110. {{end}}
  111. <div class="ui basic jump dropdown icon button poping up" data-content="{{.i18n.Tr "repo.download_archive"}}" data-variation="tiny inverted" data-position="top right">
  112. <i class="download icon"></i>
  113. <div class="menu">
  114. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  115. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  116. </div>
  117. </div>
  118. </div>
  119. {{end}}
  120. </div>
  121. </div>
  122. {{if .IsViewFile}}
  123. {{template "repo/view_file" .}}
  124. {{else}}
  125. {{template "repo/view_list" .}}
  126. {{end}}
  127. </div>
  128. </div>
  129. {{template "base/footer" .}}