my-gitea-templates/templates/repo/ header.tmpl
84 lines
3.7 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 and (.Repository.AnyUnitEnabled $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}}
  57. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  58. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  59. </a>
  60. {{end}}
  61. {{template "custom/extra_tabs" .}}
  62. {{if .IsRepositoryAdmin}}
  63. <div class="right menu">
  64. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  65. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  66. </a>
  67. </div>
  68. {{end}}
  69. </div>
  70. </div>
  71. <div class="ui tabs divider"></div>
  72. {{else}}
  73. <div class="ui divider"></div>
  74. {{end}}
  75. </div>