You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

header.tmpl 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <div class="ui secondary stackable pointing menu">
  2. {{if .HasProfileReadme}}
  3. <a class="{{if eq .TabName "overview"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=overview">
  4. {{svg "octicon-info"}} {{ctx.Locale.Tr "user.overview"}}
  5. </a>
  6. {{end}}
  7. <a class="{{if eq .TabName "repositories"}}active {{end}} item" href="{{.ContextUser.HomeLink}}?tab=repositories">
  8. {{svg "octicon-repo"}} {{ctx.Locale.Tr "user.repositories"}}
  9. {{if .RepoCount}}
  10. <div class="ui small label">{{.RepoCount}}</div>
  11. {{end}}
  12. </a>
  13. {{if or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadProjects)}}
  14. <a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if .PageIsViewProjects}}active {{end}}item">
  15. {{svg "octicon-project-symlink"}} {{ctx.Locale.Tr "user.projects"}}
  16. </a>
  17. {{end}}
  18. {{if and .IsPackageEnabled (or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadPackages))}}
  19. <a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item">
  20. {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
  21. </a>
  22. {{end}}
  23. {{if and .IsRepoIndexerEnabled (or .ContextUser.IsIndividual (and .ContextUser.IsOrganization .CanReadCode))}}
  24. <a href="{{.ContextUser.HomeLink}}/-/code" class="{{if .IsCodePage}}active {{end}}item">
  25. {{svg "octicon-code"}} {{ctx.Locale.Tr "user.code"}}
  26. </a>
  27. {{end}}
  28. {{if .ContextUser.IsOrganization}}
  29. {{if .IsOrganizationMember}}
  30. <a class="item" href="{{$.OrgLink}}/members">
  31. {{svg "octicon-person"}}&nbsp;{{ctx.Locale.Tr "org.members"}}
  32. {{if .NumMembers}}
  33. <div class="ui small label">{{.NumMembers}}</div>
  34. {{end}}
  35. </a>
  36. <a class="item" href="{{$.OrgLink}}/teams">
  37. {{svg "octicon-people"}}&nbsp;{{ctx.Locale.Tr "org.teams"}}
  38. {{if .NumTeams}}
  39. <div class="ui small label">{{.NumTeams}}</div>
  40. {{end}}
  41. </a>
  42. {{end}}
  43. {{if .IsOrganizationOwner}}
  44. <div class="right menu">
  45. <a class="item" href="{{.OrgLink}}/settings">
  46. {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}}
  47. </a>
  48. </div>
  49. {{end}}
  50. {{else}}
  51. <a class="{{if eq .TabName "activity"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=activity">
  52. {{svg "octicon-rss"}} {{ctx.Locale.Tr "user.activity"}}
  53. </a>
  54. {{if not .DisableStars}}
  55. <a class="{{if eq .TabName "stars"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=stars">
  56. {{svg "octicon-star"}} {{ctx.Locale.Tr "user.starred"}}
  57. {{if .ContextUser.NumStars}}
  58. <div class="ui small label">{{.ContextUser.NumStars}}</div>
  59. {{end}}
  60. </a>
  61. {{else}}
  62. <a class="{{if eq .TabName "watching"}}active {{end}}item" href="{{.ContextUser.HomeLink}}?tab=watching">
  63. {{svg "octicon-eye"}} {{ctx.Locale.Tr "user.watched"}}
  64. </a>
  65. {{end}}
  66. {{end}}
  67. </div>