header.tmpl 4.3 KB

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