header.tmpl 4.1 KB

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