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.7KB

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="{{$.Mirror.Address}}">{{$.Mirror.Address}}</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. <div class="repo-buttons">
  20. <div class="ui labeled button" tabindex="0">
  21. <a class="ui compact basic button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  22. <i class="icon fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  23. </a>
  24. <a class="ui basic label" href="{{.Link}}/watchers">
  25. {{.NumWatches}}
  26. </a>
  27. </div>
  28. <div class="ui labeled button" tabindex="0">
  29. <a class="ui compact basic button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  30. <i class="icon star{{if not $.IsStaringRepo}} outline{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  31. </a>
  32. <a class="ui basic label" href="{{.Link}}/stars">
  33. {{.NumStars}}
  34. </a>
  35. </div>
  36. {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}
  37. <div class="ui labeled button {{if and ($.IsSigned) (not $.CanSignedUserFork)}}disabled-repo-button{{end}}" tabindex="0">
  38. <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">
  39. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  40. </a>
  41. <a class="ui basic label" href="{{.Link}}/forks">
  42. {{.NumForks}}
  43. </a>
  44. </div>
  45. {{end}}
  46. </div>
  47. </div><!-- end grid -->
  48. </div><!-- end container -->
  49. {{end}}
  50. {{if not .IsDiffCompare}}
  51. <div class="ui tabs container">
  52. <div class="ui tabular stackable menu navbar">
  53. {{if .Permission.CanRead $.UnitTypeCode}}
  54. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
  55. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  56. </a>
  57. {{end}}
  58. {{if .Permission.CanRead $.UnitTypeIssues}}
  59. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  60. <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>
  61. </a>
  62. {{end}}
  63. {{if .Permission.CanRead $.UnitTypeExternalTracker}}
  64. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
  65. <i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
  66. </a>
  67. {{end}}
  68. {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
  69. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  70. <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>
  71. </a>
  72. {{end}}
  73. {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
  74. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  75. <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>
  76. </a>
  77. {{end}}
  78. {{if or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki)}}
  79. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalWiki)}} target="_blank" rel="noopener noreferrer" {{end}}>
  80. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  81. </a>
  82. {{end}}
  83. {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}}
  84. <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
  85. <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
  86. </a>
  87. {{end}}
  88. {{template "custom/extra_tabs" .}}
  89. {{if .Permission.IsAdmin}}
  90. <div class="right menu">
  91. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  92. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  93. </a>
  94. </div>
  95. {{end}}
  96. </div>
  97. </div>
  98. <div class="ui tabs divider"></div>
  99. {{else}}
  100. <div class="ui divider"></div>
  101. {{end}}
  102. </div>