header.tmpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {{with .Repository}}
  2. <div class="ui container"><!-- start container -->
  3. <div class="ui vertically padded grid head"><!-- start grid -->
  4. <div class="column"><!-- start column -->
  5. <div class="ui header">
  6. <div class="ui huge breadcrumb">
  7. <i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
  8. <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
  9. <div class="divider"> / </div>
  10. <a href="{{$.RepoLink}}">{{.Name}}</a>
  11. {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" href="{{$.MirrorAddress}}">{{$.Mirror.Address}}</a></div>{{end}}
  12. {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.RepoLink}}">{{SubStr .BaseRepo.RepoLink 1 -1}}</a></div>{{end}}
  13. </div>
  14. <div class="ui right">
  15. <div class="ui labeled button" tabindex="0">
  16. <a class="ui button" href="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
  17. <i class="icon fa fa-eye{{if not $.IsWatchingRepo}}-slash{{end}}"></i>{{if $.IsWatchingRepo}}{{$.i18n.Tr "repo.unwatch"}}{{else}}{{$.i18n.Tr "repo.watch"}}{{end}}
  18. </a>
  19. <a class="ui basic label" href="{{.RepoLink}}/watchers">
  20. {{.NumWatches}}
  21. </a>
  22. </div>
  23. <div class="ui labeled button" tabindex="0">
  24. <a class="ui button" href="{{$.RepoLink}}/action/{{if $.IsStaringRepo}}un{{end}}star?redirect_to={{$.Link}}">
  25. <i class="icon fa-star{{if not $.IsStaringRepo}}-o{{end}}"></i>{{if $.IsStaringRepo}}{{$.i18n.Tr "repo.unstar"}}{{else}}{{$.i18n.Tr "repo.star"}}{{end}}
  26. </a>
  27. <a class="ui basic label" href="{{.RepoLink}}/stars">
  28. {{.NumStars}}
  29. </a>
  30. </div>
  31. {{if .CanBeForked}}
  32. <div class="ui labeled button" tabindex="0">
  33. <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}}>
  34. <i class="icon octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
  35. </a>
  36. <a class="ui basic label" href="{{.RepoLink}}/forks">
  37. {{.NumForks}}
  38. </a>
  39. </div>
  40. {{end}}
  41. </div>
  42. </div>
  43. </div><!-- end column -->
  44. </div><!-- end grid -->
  45. </div><!-- end container -->
  46. {{end}}
  47. {{if not (or .IsBareRepo .IsDiffCompare)}}
  48. <div class="ui tabs container">
  49. <div class="ui tabular menu navbar">
  50. <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}">
  51. <i class="icon octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
  52. </a>
  53. {{if .Repository.EnableIssues}}
  54. <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
  55. <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>
  56. </a>
  57. {{end}}
  58. {{if .Repository.EnablePulls}}
  59. <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
  60. <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>
  61. </a>
  62. {{end}}
  63. <a class="{{if .PageIsCommits}}active{{end}} item" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}">
  64. <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>
  65. </a>
  66. <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
  67. <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>
  68. </a>
  69. {{if .Repository.EnableWiki}}
  70. <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki">
  71. <i class="icon 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="icon 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}}