Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

header.tmpl 5.5KB

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