header.tmpl 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. <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-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="{{.Link}}/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="{{.Link}}/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}}" href="{{AppSubUrl}}/repo/fork/{{.ID}}">
  35. <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  36. </a>
  37. <a class="ui basic label" href="{{.Link}}/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. {{end}}
  48. {{if not (or .IsBareRepo .IsDiffCompare)}}
  49. <div class="ui tabs container">
  50. <div class="ui tabular menu navbar">
  51. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  52. <i class="octicon octicon-file-text"></i> {{.i18n.Tr "repo.files"}}
  53. </a>
  54. {{if .Repository.EnableIssues}}
  55. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  56. <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>
  57. </a>
  58. {{end}}
  59. {{if .Repository.AllowsPulls}}
  60. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  61. <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>
  62. </a>
  63. {{end}}
  64. <a class="{{if (or (.PageIsCommits) (.PageIsDiff))}}active{{end}} item" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}">
  65. <i class="octicon octicon-history"></i> {{.i18n.Tr "repo.commits"}} <span class="ui {{if not .CommitsCount}}gray{{else}}blue{{end}} small label">{{.CommitsCount}}</span>
  66. </a>
  67. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  68. <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumTags}}gray{{else}}blue{{end}} small label">{{.Repository.NumTags}}</span>
  69. </a>
  70. {{if .Repository.EnableWiki}}
  71. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  72. <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
  73. </a>
  74. {{end}}
  75. {{if .IsRepositoryAdmin}}
  76. <div class="right menu">
  77. <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
  78. <i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}
  79. </a>
  80. </div>
  81. {{end}}
  82. </div>
  83. </div>
  84. <div class="ui tabs divider"></div>
  85. {{else}}
  86. <div class="ui divider"></div>
  87. {{end}}
  88. </div>