home.tmpl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 has-emoji">{{.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 .PullRequestCtx.Allowed}}
  11. <div class="fitted item">
  12. <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">
  13. <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
  14. </a>
  15. </div>
  16. {{end}}
  17. {{template "repo/branch_dropdown" .}}
  18. <div class="item fitted">
  19. <div class="ui breadcrumb">
  20. <a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{.Repository.Name}}</a>
  21. {{ $n := len .Treenames}}
  22. {{ $l := Subtract $n 1}}
  23. {{range $i, $v := .Treenames}}
  24. <div class="divider"> / </div>
  25. {{if eq $i $l}}
  26. <span class="active section">{{$v}}</span>
  27. {{else}}
  28. {{ $p := index $.Paths $i}}
  29. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{$v}}</a></span>
  30. {{end}}
  31. {{end}}
  32. </div>
  33. </div>
  34. {{if eq $n 0}}
  35. <div class="right fitted item">
  36. <div class="ui action small input" id="clone-panel">
  37. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  38. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  39. </button>
  40. {{if not $.DisableSSH}}
  41. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  42. SSH
  43. </button>
  44. {{end}}
  45. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  46. <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">
  47. <i class="octicon octicon-clippy"></i>
  48. </button>
  49. <div class="ui basic jump dropdown icon button">
  50. <i class="download icon"></i>
  51. <div class="menu">
  52. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  53. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. {{end}}
  59. </div>
  60. {{if .IsFile}}
  61. {{template "repo/view_file" .}}
  62. {{else}}
  63. {{template "repo/view_list" .}}
  64. {{end}}
  65. </div>
  66. </div>
  67. {{template "base/footer" .}}