my-gitea-templates/templates/repo/ header.tmpl
90 lines
4.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 class="ui eight wide right aligned column">
  16. <div class="ui compact labeled button" tabindex="0">
  17. <a class="ui compact button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  18. <i class="icon fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  19. </a>
  20. <a class="ui basic label" href="{{.Link}}/watchers">
  21. {{.NumWatches}}
  22. </a>
  23. </div>
  24. </div>
  25. </div><!-- end grid -->
  26. </div><!-- end container -->
  27. {{end}}
  28. {{if not .IsDiffCompare}}
  29. <div class="ui tabs container">
  30. <div class="ui tabular stackable menu navbar">
  31. {{if .Repository.UnitEnabled $.UnitTypeCode}}
  32. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  33. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  34. </a>
  35. {{end}}
  36. {{if .Repository.UnitEnabled $.UnitTypeIssues}}
  37. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  38. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
  39. </a>
  40. {{end}}
  41. {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}
  42. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" target="_blank">
  43. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
  44. </a>
  45. {{end}}
  46. {{if .Repository.AllowsPulls}}
  47. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  48. <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui {{if not .Repository.NumOpenPulls}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenPulls}}</span>
  49. </a>
  50. {{end}}
  51. {{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
  52. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  53. <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumReleases}}gray{{else}}blue{{end}} small label">{{.Repository.NumReleases}}</span>
  54. </a>
  55. {{end}}
  56. {{if or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  57. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Repository.UnitEnabled $.UnitTypeExternalWiki)}} target="_blank" {{end}}>
  58. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  59. </a>
  60. {{end}}
  61. {{if and (.Repository.AnyUnitEnabled $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}}
  62. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  63. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  64. </a>
  65. {{end}}
  66. {{template "custom/extra_tabs" .}}
  67. {{if .IsRepositoryAdmin}}
  68. <div class="right menu">
  69. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  70. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  71. </a>
  72. </div>
  73. {{end}}
  74. </div>
  75. </div>
  76. <div class="ui tabs divider"></div>
  77. {{else}}
  78. <div class="ui divider"></div>
  79. {{end}}
  80. </div>