header.tmpl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. {{if .UseCustomAvatar}}
  9. <img class="ui mini spaced image" src="{{.RelAvatarLink}}">
  10. <i class="{{if .IsPrivate}}mega-octicon octicon-lock{{else if .IsUnlisted}}mega-octicon octicon-eye{{else if .IsMirror}}mega-octicon octicon-repo-clone{{else if .IsFork}}mega-octicon octicon-repo-forked{{end}}"></i>
  11. {{else}}
  12. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsUnlisted}}eye{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  13. {{end}}
  14. <a href="{{AppSubURL}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  15. <div class="divider"> / </div>
  16. <a href="{{$.RepoLink}}">{{.Name}}</a>
  17. {{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}}
  18. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  19. </div>
  20. {{if not $.IsGuest}}
  21. <div class="ui right">
  22. {{template "repo/header_gin" $}}
  23. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}" method="POST">
  24. {{$.CSRFTokenHTML}}
  25. <div class="ui labeled button" tabindex="0">
  26. <button class="ui basic button">
  27. <i class="eye{{if not $.IsWatchingRepo}} slash outline{{end}} icon"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  28. </button>
  29. <a class="ui basic label" href="{{.Link}}/watchers">
  30. {{.NumWatches}}
  31. </a>
  32. </div>
  33. </form>
  34. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}" method="POST">
  35. {{$.CSRFTokenHTML}}
  36. <div class="ui labeled button" tabindex="0">
  37. <button class="ui basic button">
  38. <i class="star{{if not $.IsStaringRepo}} outline{{end}} icon"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  39. </button>
  40. <a class="ui basic label" href="{{.Link}}/stars">
  41. {{.NumStars}}
  42. </a>
  43. </div>
  44. </form>
  45. {{if .CanBeForked}}
  46. <div class="ui labeled button" tabindex="0" data-tooltip="Please note: annexed file content will not be forked" data-position="bottom center">
  47. <a class="ui basic button {{if eq .OwnerID $.LoggedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}">
  48. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  49. </a>
  50. <a class="ui basic label" href="{{.Link}}/forks">
  51. {{.NumForks}}
  52. </a>
  53. </div>
  54. {{end}}
  55. </div>
  56. {{end}}
  57. </div>
  58. </div><!-- end column -->
  59. </div><!-- end grid -->
  60. </div><!-- end container -->
  61. {{end}}
  62. {{if not .IsDiffCompare}}
  63. <div class="ui tabs container">
  64. <div class="ui tabular menu navbar">
  65. {{if not $.IsGuest}}
  66. <a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}">
  67. <i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}}
  68. </a>
  69. {{end}}
  70. {{if .Repository.EnableIssues}}
  71. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  72. <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} {{if not .Repository.EnableExternalTracker}}<span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}{{end}}</span>
  73. </a>
  74. {{end}}
  75. {{if and .Repository.AllowsPulls (not .IsGuest)}}
  76. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  77. <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>
  78. </a>
  79. {{end}}
  80. {{if .Repository.EnableWiki}}
  81. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  82. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  83. </a>
  84. {{end}}
  85. {{if .IsRepositoryAdmin}}
  86. <div class="right menu">
  87. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  88. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  89. </a>
  90. </div>
  91. {{end}}
  92. </div>
  93. </div>
  94. <div class="ui tabs divider"></div>
  95. {{else}}
  96. <div class="ui divider"></div>
  97. {{end}}
  98. </div>