home.tmpl 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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}}">{{EllipsisString .Repository.Name 25}}</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">{{EllipsisString $v 15}}</span>
  28. {{else}}
  29. {{ $p := index $.Paths $i}}
  30. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 15}}</a></span>
  31. {{end}}
  32. {{end}}
  33. </div>
  34. </div>
  35. <div class="right fitted item">
  36. {{if .Repository.CanEnableEditor}}
  37. <div id="file-buttons" class="ui tiny blue buttons">
  38. {{if .CanAddFile}}
  39. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  40. {{.i18n.Tr "repo.editor.new_file"}}
  41. </a>
  42. {{end}}
  43. {{if .CanUploadFile}}
  44. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  45. {{.i18n.Tr "repo.editor.upload_file"}}
  46. </a>
  47. {{end}}
  48. </div>
  49. {{end}}
  50. <!-- Only show colne panel in repository home page -->
  51. {{if eq $n 0}}
  52. <div class="ui action small input" id="clone-panel">
  53. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  54. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  55. </button>
  56. {{if not $.DisableSSH}}
  57. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  58. SSH
  59. </button>
  60. {{end}}
  61. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  62. <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">
  63. <i class="octicon octicon-clippy"></i>
  64. </button>
  65. <div class="ui basic jump dropdown icon button">
  66. <i class="download icon"></i>
  67. <div class="menu">
  68. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  69. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  70. </div>
  71. </div>
  72. </div>
  73. {{end}}
  74. </div>
  75. </div>
  76. {{if .IsViewFile}}
  77. {{template "repo/view_file" .}}
  78. {{else}}
  79. {{template "repo/view_list" .}}
  80. {{end}}
  81. </div>
  82. </div>
  83. {{template "base/footer" .}}