header.tmpl 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {{with .Repository}}
  2. <div id="repo-header" class="clear">
  3. <div class="container clear">
  4. <h1 id="repo-header-name" class="left public">
  5. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  6. <a class="author" href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  7. <span class="divider">/</span>
  8. <a class="repo text-bold" href="{{$.RepoLink}}">{{.Name}}</a>
  9. {{if .IsMirror}}<span class="label label-gray">{{$.i18n.Tr "mirror"}}</span>{{end}}
  10. {{if .IsFork}}<span class="fork-flag">forked from <a href="{{.ForkRepo.RepoLink}}">{{SubStr .ForkRepo.RepoLink 1 -1}}</a></span>{{end}}
  11. </h1>
  12. <ul id="repo-header-meta" class="right menu menu-line">
  13. <li id="repo-header-download" class="drop">
  14. <a id="repo-header-download-btn" href="#">
  15. <button class="btn btn-black text-bold btn-radius">
  16. <i class="octicon octicon-cloud-download"></i>
  17. </button>
  18. </a>
  19. <div id="repo-header-download-drop" class="drop-down">
  20. <div id="repo-clone" class="clear">
  21. {{if not $.DisableSSH}}
  22. <button class="btn btn-blue left btn-left-radius" id="repo-clone-ssh" data-link="{{$.CloneLink.SSH}}">SSH</button>
  23. {{end}}
  24. <button class="btn {{if $.DisableSSH}}btn-blue{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{$.CloneLink.HTTPS}}">HTTPS</button>
  25. <input id="repo-clone-url" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" onclick="this.select();" readonly />
  26. <button id="repo-clone-copy" class="btn btn-black left btn-right-radius" data-copy-val="val" data-copy-from="#repo-clone-url" original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-after-title="{{$.i18n.Tr "repo.copied"}}">{{$.i18n.Tr "repo.copy_link"}}</button>
  27. <p class="text-center" id="repo-clone-help">{{$.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p>
  28. <hr/>
  29. <div class="text-center" id="repo-clone-zip">
  30. <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
  31. <a class="btn btn-green btn-radius" href="{{$.RepoLink}}/archive/{{EscapePound $.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
  32. </div>
  33. </div>
  34. </div>
  35. </li>
  36. <li id="repo-header-watch">
  37. <a id="repo-header-watch-btn" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch">
  38. <button class="btn btn-gray text-bold btn-radius">
  39. <i class="octicon octicon-eye-watch"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}<span class="num">{{.NumWatches}}</span>
  40. </button>
  41. </a>
  42. </li>
  43. <li id="repo-header-star">
  44. <a id="repo-header-star-btn" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star">
  45. <button class="btn btn-gray text-bold btn-radius">
  46. <i class="octicon octicon-star"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  47. <span class="num">{{.NumStars}}</span>
  48. </button>
  49. </a>
  50. </li>
  51. <li id="repo-header-fork">
  52. <a id="repo-header-fork-btn" {{if or (not $.IsRepositoryTrueOwner) $.Owner.IsOrganization}}href="{{AppSubUrl}}/repo/fork?fork_id={{.Id}}"{{end}}>
  53. <button class="btn btn-gray text-bold btn-radius">
  54. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  55. <span class="num">{{.NumForks}}</span>
  56. </button>
  57. </a>
  58. </li>
  59. </ul>
  60. </div>
  61. </div>
  62. {{end}}