header.tmpl 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {{with .Repository}}
  2. <div class="header-wrapper">
  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.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></div>{{end}}
  14. </div>
  15. <div class="ui right">
  16. <div class="ui labeled button" tabindex="0">
  17. <a class="ui button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  18. <i class="icon fa fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  19. </a>
  20. <a class="ui basic label" href="{{.RepoLink}}/watchers">
  21. {{.NumWatches}}
  22. </a>
  23. </div>
  24. <div class="ui labeled button" tabindex="0">
  25. <a class="ui button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  26. <i class="icon fa-star{{if not $.IsStaringRepo}}-o{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  27. </a>
  28. <a class="ui basic label" href="{{.RepoLink}}/stars">
  29. {{.NumStars}}
  30. </a>
  31. </div>
  32. {{if .CanBeForked}}
  33. <div class="ui labeled button" tabindex="0">
  34. <a class="ui button {{if eq .OwnerID $.SignedUserID}}poping up{{end}}" {{if not (eq .OwnerID $.SignedUserID)}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
  35. <i class="icon octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  36. </a>
  37. <a class="ui basic label" href="{{.RepoLink}}/forks">
  38. {{.NumForks}}
  39. </a>
  40. </div>
  41. {{end}}
  42. </div>
  43. </div>
  44. </div><!-- end column -->
  45. </div><!-- end grid -->
  46. </div><!-- end container -->
  47. </div>
  48. {{end}}
  49. {{if not (or .IsBareRepo .IsDiffCompare)}}
  50. <div class="header-wrapper">
  51. <div class="ui tabs container">
  52. <div class="ui tabular menu navbar">
  53. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  54. <i class="icon octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  55. </a>
  56. {{if .Repository.EnableIssues}}
  57. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  58. <i class="icon octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
  59. </a>
  60. {{end}}
  61. {{if .Repository.EnablePulls}}
  62. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  63. <i class="icon 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>
  64. </a>
  65. {{end}}
  66. <a class="{{if (or (.PageIsCommits) (.PageIsDiff))}}active{{end}} item" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}">
  67. <i class="icon octicon octicon-history"></i> {{.i18n.Tr "repo.commits"}} <span class="ui {{if not .CommitsCount}}gray{{else}}blue{{end}} small label">{{.CommitsCount}}</span>
  68. </a>
  69. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  70. <i class="icon octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumTags}}gray{{else}}blue{{end}} small label">{{.Repository.NumTags}}</span>
  71. </a>
  72. {{if .Repository.EnableWiki}}
  73. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  74. <i class="icon octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  75. </a>
  76. {{end}}
  77. {{if .IsRepositoryAdmin}}
  78. <div class="right menu">
  79. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  80. <i class="icon octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  81. </a>
  82. </div>
  83. {{end}}
  84. </div>
  85. </div>
  86. </div>
  87. <div class="ui tabs divider"></div>
  88. {{else}}
  89. <div class="ui divider"></div>
  90. {{end}}