home.tmpl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{template "base/head" .}}
  2. <div class="repository file list">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. {{if .PageIsRepoHome}}
  7. <p id="repo-desc">
  8. {{if .Repository.Description}}<span class="description has-emoji">{{.Repository.Description | Str2html}}</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. </p>
  11. <div class="ui segment" id="git-stats">
  12. <div class="ui two horizontal center link list">
  13. <div class="item">
  14. <a href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}"><span class="ui text black"><i class="octicon octicon-history"></i> <b>{{.CommitsCount}}</b> {{.i18n.Tr "repo.commits"}}</span> </a>
  15. </div>
  16. <div class="item">
  17. <a href="{{.RepoLink}}/branches"><span class="ui text black"><i class="octicon octicon-git-branch"></i><b>{{.BrancheCount}}</b> {{.i18n.Tr "repo.git_branches"}}</span> </a>
  18. </div>
  19. <div class="item">
  20. <a href="{{.RepoLink}}/releases"><span class="ui text black"><i class="octicon octicon-tag"></i> <b>{{.Repository.NumTags}}</b> {{.i18n.Tr "repo.releases"}}</span> </a>
  21. </div>
  22. </div>
  23. </div>
  24. {{end}}
  25. <div class="ui secondary menu">
  26. {{if .PullRequestCtx.Allowed}}
  27. <div class="fitted item">
  28. <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">
  29. <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
  30. </a>
  31. </div>
  32. {{end}}
  33. {{template "repo/branch_dropdown" .}}
  34. <div class="fitted item">
  35. <div class="ui breadcrumb">
  36. <a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{EllipsisString .Repository.Name 15}}</a>
  37. {{ $n := len .TreeNames}}
  38. {{ $l := Subtract $n 1}}
  39. {{range $i, $v := .TreeNames}}
  40. <div class="divider"> / </div>
  41. {{if eq $i $l}}
  42. <span class="active section">{{$v}}</span>
  43. {{else}}
  44. {{ $p := index $.Paths $i}}
  45. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{$v}}</a></span>
  46. {{end}}
  47. {{end}}
  48. </div>
  49. </div>
  50. <div class="right fitted item">
  51. {{if .Repository.CanEnableEditor}}
  52. <div id="file-buttons" class="ui tiny blue buttons">
  53. {{if .CanAddFile}}
  54. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  55. {{.i18n.Tr "repo.editor.new_file"}}
  56. </a>
  57. {{end}}
  58. {{if .CanUploadFile}}
  59. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  60. {{.i18n.Tr "repo.editor.upload_file"}}
  61. </a>
  62. {{end}}
  63. </div>
  64. {{end}}
  65. <!-- Only show colne panel in repository home page -->
  66. {{if eq $n 0}}
  67. <div class="ui action small input" id="clone-panel">
  68. {{if not $.DisableHTTP}}
  69. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  70. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  71. </button>
  72. {{end}}
  73. {{if not $.DisableSSH}}
  74. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  75. SSH
  76. </button>
  77. {{end}}
  78. <input id="repo-clone-url" value="{{if not $.DisableHTTP}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
  79. <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">
  80. <i class="octicon octicon-clippy"></i>
  81. </button>
  82. <div class="ui basic jump dropdown icon button">
  83. <i class="download icon"></i>
  84. <div class="menu">
  85. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  86. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  87. </div>
  88. </div>
  89. </div>
  90. {{end}}
  91. </div>
  92. </div>
  93. {{if .IsViewFile}}
  94. {{template "repo/view_file" .}}
  95. {{else}}
  96. {{template "repo/view_list" .}}
  97. {{end}}
  98. </div>
  99. </div>
  100. {{template "base/footer" .}}