home.tmpl 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 15}}</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. {{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. <input id="repo-clone-url" value="{{if not $.DisableHTTP}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
  64. <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">
  65. <i class="octicon octicon-clippy"></i>
  66. </button>
  67. <div class="ui basic jump dropdown icon button">
  68. <i class="download icon"></i>
  69. <div class="menu">
  70. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  71. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  72. </div>
  73. </div>
  74. </div>
  75. {{end}}
  76. </div>
  77. </div>
  78. {{if .IsViewFile}}
  79. {{template "repo/view_file" .}}
  80. {{else}}
  81. {{template "repo/view_list" .}}
  82. {{end}}
  83. </div>
  84. </div>
  85. {{template "base/footer" .}}