home.tmpl 2.9 KB

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