header.tmpl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. <div class="ui labeled button" tabindex="0">
  27. <a class="ui basic button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  28. <i class="menu-icon octicon">👀</i> {{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  29. </a>
  30. <a class="ui basic label" href="{{.Link}}/watchers">
  31. {{.NumWatches}}
  32. </a>
  33. </div>
  34. <div class="ui labeled button" tabindex="0">
  35. <a class="ui basic button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  36. {{if $.IsStaringRepo}}
  37. <i class="menu-icon octicon">🌟</i> {{$.i18n.Tr "repo.unstar"}}
  38. {{else}}
  39. <i class="menu-icon octicon">⭐</i> {{$.i18n.Tr "repo.star"}}
  40. {{end}}
  41. </a>
  42. <a class="ui basic label" href="{{.Link}}/stars">
  43. {{.NumStars}}
  44. </a>
  45. </div>
  46. {{if .CanBeForked}}
  47. <div class="ui labeled button" tabindex="0">
  48. <a class="ui basic button {{if eq .OwnerID $.LoggedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}">
  49. <i class="menu-icon octicon">🌵</i> {{$.i18n.Tr "repo.fork"}}
  50. </a>
  51. <a class="ui basic label" href="{{.Link}}/forks">
  52. {{.NumForks}}
  53. </a>
  54. </div>
  55. {{end}}
  56. </div>
  57. {{end}}
  58. </div>
  59. </div><!-- end column -->
  60. </div><!-- end grid -->
  61. </div><!-- end container -->
  62. {{end}}
  63. {{if not .IsDiffCompare}}
  64. <div class="ui tabs container">
  65. <div class="ui tabular menu navbar">
  66. {{if not $.IsGuest}}
  67. <a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}">
  68. <i class="menu-icon octicon">📋</i> {{.i18n.Tr "repo.files"}}
  69. </a>
  70. {{end}}
  71. {{if .Repository.EnableIssues}}
  72. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  73. <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>
  74. </a>
  75. {{end}}
  76. {{if and .Repository.AllowsPulls (not .IsGuest)}}
  77. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  78. <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>
  79. </a>
  80. {{end}}
  81. {{if .Repository.EnableWiki}}
  82. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  83. <i class="menu-icon octicon">📜</i> {{.i18n.Tr "repo.wiki"}}
  84. </a>
  85. {{end}}
  86. {{if and .Repository.DonateURL .Repository.DonateBadge}}
  87. <a class="item" href="{{.Repository.DonateURL}}" target="_blank">
  88. <img style="width:5rem" src="{{.Repository.DonateBadge}}">
  89. </a>
  90. {{end}}
  91. {{if .IsRepositoryAdmin}}
  92. <div class="right menu">
  93. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  94. <i class="menu-icon octicon">🛠️</i> {{.i18n.Tr "repo.settings"}}
  95. </a>
  96. </div>
  97. {{end}}
  98. </div>
  99. </div>
  100. <div class="ui tabs divider"></div>
  101. {{else}}
  102. <div class="ui divider"></div>
  103. {{end}}
  104. </div>