my-gitea-templates/templates/repo/ header.tmpl
73 lines
3.0 KiB

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