header.tmpl 5.2 KB

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