You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

home.tmpl 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. {{if not $.DisableHTTP}}
  54. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  55. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  56. </button>
  57. {{end}}
  58. {{if not $.DisableSSH}}
  59. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  60. SSH
  61. </button>
  62. {{end}}
  63. {{if not $.DisableHTTP}}
  64. <input id="repo-clone-url" value="{{$.CloneLink.HTTPS}}" readonly>
  65. {{else}}
  66. <input id="repo-clone-url" value="{{$.CloneLink.SSH}}" readonly>
  67. {{end}}
  68. <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">
  69. <i class="octicon octicon-clippy"></i>
  70. </button>
  71. <div class="ui basic jump dropdown icon button poping up" data-content="{{.i18n.Tr "repo.download_archive"}}" data-variation="tiny inverted" data-position="top right">
  72. <i class="download icon"></i>
  73. <div class="menu">
  74. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  75. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  76. </div>
  77. </div>
  78. </div>
  79. {{end}}
  80. </div>
  81. </div>
  82. {{if .IsViewFile}}
  83. {{template "repo/view_file" .}}
  84. {{else}}
  85. {{template "repo/view_list" .}}
  86. {{end}}
  87. </div>
  88. </div>
  89. {{template "base/footer" .}}