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.

107 lines
5.1 KiB

  1. <div class="header-wrapper">
  2. {{with .Repository}}
  3. <div class="ui container"><!-- start container -->
  4. <div class="ui vertically padded grid head"><!-- start grid -->
  5. <div class="column"><!-- start column -->
  6. <div class="ui header">
  7. <div class="ui huge breadcrumb">
  8. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  9. <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  10. <div class="divider"> / </div>
  11. <a href="{{$.RepoLink}}">{{.Name}}</a>
  12. {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
  13. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  14. </div>
  15. <div class="ui right">
  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 class="ui compact labeled button" tabindex="0">
  25. <a class="ui compact button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  26. <i class="icon fa-star{{if not $.IsStaringRepo}}-o{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  27. </a>
  28. <a class="ui basic label" href="{{.Link}}/stars">
  29. {{.NumStars}}
  30. </a>
  31. </div>
  32. {{if .CanBeForked}}
  33. <div class="ui compact labeled button" tabindex="0">
  34. <a class="ui compact button {{if eq .OwnerID $.SignedUserID}}poping up{{end}}" {{if not (eq .OwnerID $.SignedUserID)}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
  35. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  36. </a>
  37. <a class="ui basic label" href="{{.Link}}/forks">
  38. {{.NumForks}}
  39. </a>
  40. </div>
  41. {{end}}
  42. </div>
  43. </div>
  44. </div><!-- end column -->
  45. </div><!-- end grid -->
  46. </div><!-- end container -->
  47. {{end}}
  48. {{if not .IsDiffCompare}}
  49. <div class="ui tabs container">
  50. <div class="ui tabular stackable menu navbar">
  51. {{if .Repository.UnitEnabled $.UnitTypeCode}}
  52. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  53. <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  54. </a>
  55. {{end}}
  56. {{if .Repository.UnitEnabled $.UnitTypeIssues}}
  57. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  58. <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>
  59. </a>
  60. {{end}}
  61. {{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}
  62. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  63. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
  64. </a>
  65. {{end}}
  66. {{if .Repository.AllowsPulls}}
  67. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  68. <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>
  69. </a>
  70. {{end}}
  71. {{if and (.Repository.UnitEnabled $.UnitTypeCode) (not .IsBareRepo)}}
  72. <a class="{{if (or (.PageIsCommits) (.PageIsDiff))}}active{{end}} item" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}">
  73. <i class="octicon octicon-history"></i> {{.i18n.Tr "repo.commits"}} <span class="ui {{if not .CommitsCount}}gray{{else}}blue{{end}} small label">{{.CommitsCount}}</span>
  74. </a>
  75. {{end}}
  76. {{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
  77. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  78. <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumTags}}gray{{else}}blue{{end}} small label">{{.Repository.NumTags}}</span>
  79. </a>
  80. {{end}}
  81. {{if or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
  82. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  83. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  84. </a>
  85. {{end}}
  86. {{if .IsRepositoryAdmin}}
  87. <div class="right menu">
  88. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  89. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  90. </a>
  91. </div>
  92. {{end}}
  93. </div>
  94. </div>
  95. <div class="ui tabs divider"></div>
  96. {{else}}
  97. <div class="ui divider"></div>
  98. {{end}}
  99. </div>