header.tmpl 4.0 KB

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