header.tmpl 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 .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 .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. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}" method="POST">
  23. {{$.CSRFTokenHTML}}
  24. <div class="ui labeled button" tabindex="0">
  25. <button class="ui basic button">
  26. <i class="eye{{if not $.IsWatchingRepo}} slash outline{{end}} icon"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  27. </button>
  28. <a class="ui basic label" href="{{.Link}}/watchers">
  29. {{.NumWatches}}
  30. </a>
  31. </div>
  32. </form>
  33. <form class="display inline" action="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}" method="POST">
  34. {{$.CSRFTokenHTML}}
  35. <div class="ui labeled button" tabindex="0">
  36. <button class="ui basic button">
  37. <i class="star{{if not $.IsStaringRepo}} outline{{end}} icon"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  38. </button>
  39. <a class="ui basic label" href="{{.Link}}/stars">
  40. {{.NumStars}}
  41. </a>
  42. </div>
  43. </form>
  44. {{if .CanBeForked}}
  45. <div class="ui labeled button" tabindex="0">
  46. <a class="ui basic button {{if eq .OwnerID $.LoggedUserID}}poping up{{end}}" href="{{AppSubURL}}/repo/fork/{{.ID}}">
  47. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  48. </a>
  49. <a class="ui basic label" href="{{.Link}}/forks">
  50. {{.NumForks}}
  51. </a>
  52. </div>
  53. {{end}}
  54. </div>
  55. {{end}}
  56. </div>
  57. </div><!-- end column -->
  58. </div><!-- end grid -->
  59. </div><!-- end container -->
  60. {{end}}
  61. {{if not .IsDiffCompare}}
  62. <div class="ui tabs container">
  63. <div class="ui tabular menu navbar">
  64. {{if not $.IsGuest}}
  65. <a class="{{if .PageIsViewFiles}}active{{end}} item" href="{{.RepoLink}}">
  66. <i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}}
  67. </a>
  68. {{end}}
  69. {{if .Repository.EnableIssues}}
  70. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  71. <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>
  72. </a>
  73. {{end}}
  74. {{if and .Repository.AllowsPulls (not .IsGuest)}}
  75. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  76. <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>
  77. </a>
  78. {{end}}
  79. {{if .Repository.EnableWiki}}
  80. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  81. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  82. </a>
  83. {{end}}
  84. {{if .IsRepositoryAdmin}}
  85. <div class="right menu">
  86. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  87. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  88. </a>
  89. </div>
  90. {{end}}
  91. </div>
  92. </div>
  93. <div class="ui tabs divider"></div>
  94. {{else}}
  95. <div class="ui divider"></div>
  96. {{end}}
  97. </div>