header.tmpl 3.2 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <div class="header-wrapper">
  2. {{with .Repository}}
  3. <div class="ui container repo-header">
  4. <div class="ui stackable grid header-grid">
  5. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  6. <div class="ui huge breadcrumb">
  7. {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
  8. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  9. <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  10. <div class="divider"> / </div>
  11. <a href="{{$.RepoLink}}">{{.Name}}</a>
  12. </div>
  13. <div class="ui repo-description">
  14. <div id="repo-desc">
  15. {{if .DescriptionHTML}}<span class="description has-emoji">{{.DescriptionHTML}}</span>{{end}}
  16. <a class="link" href="{{.Website}}">{{.Website}}</a>
  17. </div>
  18. </div>
  19. </div><!-- end grid -->
  20. </div><!-- end container -->
  21. {{end}}
  22. {{if not .IsDiffCompare}}
  23. <div class="ui tabs container">
  24. <div class="ui tabular stackable menu navbar">
  25. {{if .Repository.UnitEnabled $.UnitTypeCode}}
  26. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  27. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  28. </a>
  29. {{end}}
  30. {{if .Repository.UnitEnabled $.UnitTypeIssues}}
  31. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  32. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui small label">{{.Repository.NumOpenIssues}}</span>
  33. </a>
  34. {{end}}
  35. {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}
  36. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" target="_blank">
  37. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
  38. </a>
  39. {{end}}
  40. {{if .Repository.AllowsPulls}}
  41. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  42. <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui small label">{{.Repository.NumOpenPulls}}</span>
  43. </a>
  44. {{end}}
  45. {{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
  46. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  47. <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui small label">{{.Repository.NumReleases}}</span>
  48. </a>
  49. {{end}}
  50. {{if and (.Repository.AnyUnitEnabled $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}}
  51. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  52. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  53. </a>
  54. {{end}}
  55. {{template "custom/extra_tabs" .}}
  56. {{if .IsRepositoryAdmin}}
  57. <div class="right menu">
  58. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  59. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  60. </a>
  61. </div>
  62. {{end}}
  63. </div>
  64. </div>
  65. <div class="ui tabs divider"></div>
  66. {{else}}
  67. <div class="ui divider"></div>
  68. {{end}}
  69. </div>