header.tmpl 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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="ui label">{{$.i18n.Tr "mirror"}}</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 grey 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">
  20. {{.NumWatches}}
  21. </a>
  22. </div>
  23. <div class="ui labeled button" tabindex="0">
  24. <a class="ui grey 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">
  28. {{.NumStars}}
  29. </a>
  30. </div>
  31. {{if .CanBeForked}}
  32. <div class="ui labeled button" tabindex="0">
  33. <a class="ui grey 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">
  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. <div class="ui divider"></div>
  47. {{end}}