home.tmpl 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {{template "base/head" .}}
  2. <div class="repository file list">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <p id="repo-desc">
  7. {{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}}
  8. <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
  9. </p>
  10. <div class="ui secondary menu">
  11. {{if .PullRequestCtx.Allowed}}
  12. <div class="fitted item">
  13. <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">
  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="fitted item">
  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. <div class="right fitted item">
  36. <div id="file-buttons" class="ui tiny buttons">
  37. {{if .NewFileLink}}
  38. <a href="{{EscapePound .NewFileLink}}" class="ui button">
  39. {{.i18n.Tr "repo.new_file"}}
  40. </a>
  41. {{end}}
  42. {{if .UploadFileLink}}
  43. <!-- <a href="{{EscapePound .UploadFileLink}}" class="ui button nowrap">
  44. <i class="upload icon"></i> {{.i18n.Tr "repo.upload_file"}}
  45. </a> -->
  46. {{end}}
  47. </div>
  48. {{if eq $n 0}}
  49. <div class="ui action small input" id="clone-panel">
  50. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  51. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  52. </button>
  53. {{if not $.DisableSSH}}
  54. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  55. SSH
  56. </button>
  57. {{end}}
  58. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  59. <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">
  60. <i class="octicon octicon-clippy"></i>
  61. </button>
  62. <div class="ui basic jump dropdown icon button">
  63. <i class="download icon"></i>
  64. <div class="menu">
  65. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  66. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  67. </div>
  68. </div>
  69. </div>
  70. {{end}}
  71. </div>
  72. </div>
  73. {{if .IsFile}}
  74. {{template "repo/view_file" .}}
  75. {{else}}
  76. {{template "repo/view_list" .}}
  77. {{end}}
  78. </div>
  79. </div>
  80. {{template "base/footer" .}}