home.tmpl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {{template "base/head" .}}
  2. <div class="repository file list">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <p id="repo-desc">
  6. {{if .Repository.DescriptionHtml}}<span class="description">{{.Repository.DescriptionHtml}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
  7. <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
  8. </p>
  9. <div class="ui secondary menu">
  10. {{if .CanPullRequest}}
  11. <div class="fitted item">
  12. {{ $baseRepo := .Repository.BaseRepo}}
  13. <a href="{{AppSubUrl}}/{{$baseRepo.Owner.Name}}/{{$baseRepo.Name}}/compare/{{$.BaseDefaultBranch}}...{{$.Owner.Name}}:{{$.BranchName}}">
  14. <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
  15. </a>
  16. </div>
  17. {{end}}
  18. <div class="fitted item choose reference">
  19. <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
  20. <div class="ui basic small button">
  21. <span class="text">
  22. <i class="octicon octicon-git-branch"></i>
  23. {{if .IsViewBranch}}{{.i18n.Tr "repo.branch"}}{{else}}{{.i18n.Tr "repo.tree"}}{{end}}:
  24. <strong>{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</strong>
  25. </span>
  26. <i class="dropdown icon"></i>
  27. </div>
  28. <div class="menu">
  29. <div class="ui icon search input">
  30. <i class="filter icon"></i>
  31. <input name="search" placeholder="{{.i18n.Tr "repo.filter_branch_and_tag"}}...">
  32. </div>
  33. <div class="header">
  34. <div class="ui grid">
  35. <div class="two column row">
  36. <a class="reference column" href="#" data-target="#branch-list">
  37. <span class="text {{if .IsViewBranch}}black{{end}}">
  38. <i class="icon octicon octicon-git-branch"></i> {{.i18n.Tr "repo.branches"}}
  39. </span>
  40. </a>
  41. <a class="reference column" href="#" data-target="#tag-list">
  42. <span class="text {{if .IsTag}}black{{end}}">
  43. <i class="reference tags icon"></i> {{.i18n.Tr "repo.tags"}}
  44. </span>
  45. </a>
  46. </div>
  47. </div>
  48. </div>
  49. <div id="branch-list" class="scrolling menu" {{if .IsTag}}style="display: none"{{end}}>
  50. {{range .Branches}}
  51. <div class="item {{if eq $.BranchName .}}selected{{end}}" data-url="{{$.RepoLink}}/src/{{EscapePound .}}">{{.}}</div>
  52. {{end}}
  53. </div>
  54. <div id="tag-list" class="scrolling menu" {{if .IsViewBranch}}style="display: none"{{end}}>
  55. {{range .Tags}}
  56. <div class="item {{if eq $.BranchName .}}selected{{end}}" data-url="{{$.RepoLink}}/src/{{EscapePound .}}">{{.}}</div>
  57. {{end}}
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="item fitted">
  63. <div class="ui breadcrumb">
  64. <a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{.Repository.Name}}</a>
  65. {{ $n := len .Treenames}}
  66. {{ $l := Subtract $n 1}}
  67. {{range $i, $v := .Treenames}}
  68. <div class="divider"> / </div>
  69. {{if eq $i $l}}
  70. <span class="active section">{{$v}}</span>
  71. {{else}}
  72. {{ $p := index $.Paths $i}}
  73. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{$v}}</a></span>
  74. {{end}}
  75. {{end}}
  76. </div>
  77. </div>
  78. {{if eq $n 0}}
  79. <div class="right fitted item">
  80. <div class="ui action small input" id="clone-panel">
  81. {{if not $.DisableSSH}}
  82. <button class="ui blue basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  83. SSH
  84. </button>
  85. {{end}}
  86. <button class="ui {{if $.DisableSSH}}blue{{end}} basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  87. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  88. </button>
  89. <input id="repo-clone-url" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
  90. <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">
  91. <i class="octicon octicon-clippy"></i>
  92. </button>
  93. <div class="ui basic jump dropdown icon button">
  94. <i class="download icon"></i>
  95. <div class="menu">
  96. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="icon octicon octicon-file-zip"></i> ZIP</a>
  97. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="icon octicon octicon-file-zip"></i> TAR.GZ</a>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. {{end}}
  103. </div>
  104. {{if .IsFile}}
  105. {{template "repo/view_file" .}}
  106. {{else}}
  107. {{template "repo/view_list" .}}
  108. {{end}}
  109. </div>
  110. </div>
  111. {{template "base/footer" .}}