You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

header.tmpl 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <div class="header-wrapper">
  2. {{with .Repository}}
  3. <div class="ui container">
  4. <div class="repo-header">
  5. <div class="ui huge breadcrumb repo-title">
  6. {{if .RelAvatarLink}}
  7. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  8. {{else}}
  9. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  10. {{end}}
  11. <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  12. <div class="divider"> / </div>
  13. <a href="{{$.RepoLink}}">{{.Name}}</a>
  14. {{if and .RelAvatarLink .IsPrivate}}<i class="mega-octicon octicon-lock"></i>{{end}}
  15. {{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
  16. {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{MirrorAddress $.Mirror}}">{{MirrorAddress $.Mirror}}</a></div>{{end}}
  17. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  18. </div>
  19. {{if not .IsBeingCreated}}
  20. <div class="repo-buttons">
  21. <div class="ui labeled button" tabindex="0">
  22. <a class="ui compact basic button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  23. <i class="icon fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  24. </a>
  25. <a class="ui basic label" href="{{.Link}}/watchers">
  26. {{.NumWatches}}
  27. </a>
  28. </div>
  29. <div class="ui labeled button" tabindex="0">
  30. <a class="ui compact basic button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  31. <i class="icon star{{if not $.IsStaringRepo}} outline{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  32. </a>
  33. <a class="ui basic label" href="{{.Link}}/stars">
  34. {{.NumStars}}
  35. </a>
  36. </div>
  37. {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
  38. <div class="ui labeled button {{if and ($.IsSigned) (not $.CanSignedUserFork)}}disabled-repo-button{{end}}" tabindex="0">
  39. <a class="ui compact basic button {{if or (not $.IsSigned) (not $.CanSignedUserFork)}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" {{ else }} data-content="{{$.i18n.Tr "repo.fork_guest_user" }}" href="{{AppSubUrl}}/user/login?redirect_to={{AppSubUrl}}/repo/fork/{{.ID}}" {{end}} data-position="top center" data-variation="tiny">
  40. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  41. </a>
  42. <a class="ui basic label" href="{{.Link}}/forks">
  43. {{.NumForks}}
  44. </a>
  45. </div>
  46. {{end}}
  47. </div>
  48. {{end}}
  49. </div><!-- end grid -->
  50. </div><!-- end container -->
  51. {{end}}
  52. <div class="ui tabs container">
  53. {{if not .Repository.IsBeingCreated}}
  54. <div class="ui tabular stackable menu navbar">
  55. {{if .Permission.CanRead $.UnitTypeCode}}
  56. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
  57. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  58. </a>
  59. {{end}}
  60. {{if .Permission.CanRead $.UnitTypeIssues}}
  61. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  62. <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>
  63. </a>
  64. {{end}}
  65. {{if .Permission.CanRead $.UnitTypeExternalTracker}}
  66. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
  67. <i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
  68. </a>
  69. {{end}}
  70. {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
  71. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  72. <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>
  73. </a>
  74. {{end}}
  75. {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
  76. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  77. <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>
  78. </a>
  79. {{end}}
  80. {{if or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki)}}
  81. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalWiki)}} target="_blank" rel="noopener noreferrer" {{end}}>
  82. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  83. </a>
  84. {{end}}
  85. {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}}
  86. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  87. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  88. </a>
  89. {{end}}
  90. {{template "custom/extra_tabs" .}}
  91. {{if .Permission.IsAdmin}}
  92. <div class="right menu">
  93. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  94. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  95. </a>
  96. </div>
  97. {{end}}
  98. </div>
  99. {{end}}
  100. </div>
  101. <div class="ui tabs divider"></div>
  102. </div>