header.tmpl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. <a href="{{AppSubURL}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  11. <div class="divider"> / </div>
  12. <a href="{{$.RepoLink}}">{{.Name}}</a>
  13. {{if .IsVerified}}<a class="poping up" target="_blank" data-content="Verified Repository" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
  14. {{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}}
  15. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  16. {{else}}
  17. <i class="mega-octicon" style="font-size:25px">{{if .IsPrivate}}🔒{{else if .IsMirror}}🤳{{else if .IsFork}}🌵{{else}}📁{{end}}</i>
  18. <a href="{{AppSubURL}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  19. <div class="divider"> / </div>
  20. <a href="{{$.RepoLink}}">{{.Name}}</a>
  21. {{if .IsVerified}}<a class="poping up" target="_blank" data-content="Verified Repository" data-variation="inverted tiny" data-position="right center"><i class="verified octicon octicon-verified"></i></a>{{end}}
  22. {{if .IsMirror}}<div class="fork-flag" style="margin-left:34px !important;margin-top:7px !important">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
  23. {{if .IsFork}}<div class="fork-flag" style="margin-left:34px !important;margin-top:7px !important">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
  24. {{end}}
  25. </div>
  26. {{if not $.IsGuest}}
  27. <div class="ui right">
  28. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}" method="POST">
  29. {{$.CSRFTokenHTML}}
  30. <div class="ui labeled button" tabindex="0">
  31. <button class="ui basic button">
  32. <i class="menu-icon octicon">👀</i> {{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  33. </button>
  34. <a class="ui basic label" href="{{.Link}}/watchers">
  35. {{.NumWatches}}
  36. </a>
  37. </div>
  38. </form>
  39. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}" method="POST">
  40. {{$.CSRFTokenHTML}}
  41. <div class="ui labeled button" tabindex="0">
  42. <button class="ui basic button">
  43. {{if $.IsStaringRepo}}
  44. <i class="menu-icon octicon">🌟</i> {{$.i18n.Tr "repo.unstar"}}
  45. {{else}}
  46. <i class="menu-icon octicon">⭐</i> {{$.i18n.Tr "repo.star"}}
  47. {{end}}
  48. </button>
  49. <a class="ui basic label" href="{{.Link}}/stars">
  50. {{.NumStars}}
  51. </a>
  52. </div>
  53. </form>
  54. {{if .CanBeForked}}
  55. <div class="ui labeled button" tabindex="0">
  56. <a class="ui basic button {{if eq .OwnerID $.LoggedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}">
  57. <i class="menu-icon octicon">🌵</i> {{$.i18n.Tr "repo.fork"}}
  58. </a>
  59. <a class="ui basic label" href="{{.Link}}/forks">
  60. {{.NumForks}}
  61. </a>
  62. </div>
  63. {{end}}
  64. </div>
  65. {{end}}
  66. </div>
  67. </div><!-- end column -->
  68. </div><!-- end grid -->
  69. </div><!-- end container -->
  70. {{end}}
  71. {{if not .IsDiffCompare}}
  72. <div class="ui tabs container">
  73. <div class="ui tabular menu navbar">
  74. {{if not $.IsGuest}}
  75. <a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}">
  76. <i class="menu-icon octicon">📋</i> {{.i18n.Tr "repo.files"}}
  77. </a>
  78. {{end}}
  79. {{if .Repository.EnableIssues}}
  80. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  81. <i class="menu-icon octicon">📑</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>
  82. </a>
  83. {{end}}
  84. {{if and .Repository.AllowsPulls (not .IsGuest)}}
  85. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  86. <i class="menu-icon octicon">🚧</i> {{.i18n.Tr "repo.pulls"}} <span class="ui {{if not .Repository.NumOpenPulls}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenPulls}}</span>
  87. </a>
  88. {{end}}
  89. {{if .Repository.EnableWiki}}
  90. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  91. <i class="menu-icon octicon">📜</i> {{.i18n.Tr "repo.wiki"}}
  92. </a>
  93. {{end}}
  94. {{if .IsRepositoryAdmin}}
  95. <div class="right menu">
  96. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  97. <i class="menu-icon octicon">🛠️</i> {{.i18n.Tr "repo.settings"}}
  98. </a>
  99. </div>
  100. {{end}}
  101. </div>
  102. </div>
  103. <div class="ui tabs divider"></div>
  104. {{else}}
  105. <div class="ui divider"></div>
  106. {{end}}
  107. </div>