home.tmpl 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {{template "base/head" .}}
  2. <div class="repository file list">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. {{if .PageIsRepoHome}}
  7. <p id="repo-desc">
  8. {{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}}
  9. <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
  10. </p>
  11. <div class="ui segment" id="git-stats">
  12. <div class="ui two horizontal center link list">
  13. <div class="item">
  14. <a href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}"><span class="ui text black"><i class="octicon octicon-history"></i> <b>{{.CommitsCount}}</b> {{.i18n.Tr "repo.commits"}}</span> </a>
  15. </div>
  16. <div class="item">
  17. <a href="{{.RepoLink}}/releases"><span class="ui text black"><i class="octicon octicon-tag"></i> <b>{{.Repository.NumTags}}</b> {{.i18n.Tr "repo.releases"}}</span> </a>
  18. </div>
  19. </div>
  20. </div>
  21. {{end}}
  22. <div class="ui secondary menu">
  23. {{if .PullRequestCtx.Allowed}}
  24. <div class="fitted item">
  25. <a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">
  26. <button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
  27. </a>
  28. </div>
  29. {{end}}
  30. {{template "repo/branch_dropdown" .}}
  31. <div class="fitted item">
  32. <div class="ui breadcrumb">
  33. <a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchName}}">{{EllipsisString .Repository.Name 15}}</a>
  34. {{ $n := len .TreeNames}}
  35. {{ $l := Subtract $n 1}}
  36. {{range $i, $v := .TreeNames}}
  37. <div class="divider"> / </div>
  38. {{if eq $i $l}}
  39. <span class="active section">{{$v}}</span>
  40. {{else}}
  41. {{ $p := index $.Paths $i}}
  42. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{$v}}</a></span>
  43. {{end}}
  44. {{end}}
  45. </div>
  46. </div>
  47. <div class="right fitted item">
  48. {{if .Repository.CanEnableEditor}}
  49. <div id="file-buttons" class="ui tiny blue buttons">
  50. {{if .CanAddFile}}
  51. <a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  52. {{.i18n.Tr "repo.editor.new_file"}}
  53. </a>
  54. {{end}}
  55. {{if .CanUploadFile}}
  56. <a href="{{.RepoLink}}/_upload/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
  57. {{.i18n.Tr "repo.editor.upload_file"}}
  58. </a>
  59. {{end}}
  60. </div>
  61. {{end}}
  62. <!-- Only show colne panel in repository home page -->
  63. {{if eq $n 0}}
  64. <div class="ui action small input" id="clone-panel">
  65. {{if not $.DisableHTTP}}
  66. <button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
  67. {{if UseHTTPS}}HTTPS{{else}}HTTP{{end}}
  68. </button>
  69. {{end}}
  70. {{if not $.DisableSSH}}
  71. <button class="ui basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">
  72. SSH
  73. </button>
  74. {{end}}
  75. <input id="repo-clone-url" value="{{if not $.DisableHTTP}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly>
  76. <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">
  77. <i class="octicon octicon-clippy"></i>
  78. </button>
  79. <div class="ui basic jump dropdown icon button">
  80. <i class="download icon"></i>
  81. <div class="menu">
  82. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i> ZIP</a>
  83. <a class="item" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i> TAR.GZ</a>
  84. </div>
  85. </div>
  86. </div>
  87. {{end}}
  88. </div>
  89. </div>
  90. {{if .IsViewFile}}
  91. {{template "repo/view_file" .}}
  92. {{else}}
  93. {{template "repo/view_list" .}}
  94. {{end}}
  95. </div>
  96. </div>
  97. {{template "base/footer" .}}