navbar.tmpl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <div class="ui container">
  2. <div class="ui floating dropdown link jump">
  3. <span class="text">
  4. <img class="ui avatar image" src="{{.ContextUser.AvatarLink}}">
  5. {{.ContextUser.ShortName 20}}
  6. <i class="dropdown icon"></i>
  7. </span>
  8. <div class="context user overflow menu" tabindex="-1">
  9. <div class="ui header">
  10. {{.i18n.Tr "home.switch_dashboard_context"}}
  11. </div>
  12. <div class="items">
  13. <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{end}}">
  14. <img class="ui avatar image" src="{{.SignedUser.AvatarLink}}">
  15. {{.SignedUser.Name}}
  16. </a>
  17. {{range .Orgs}}
  18. <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" href="{{AppSubUrl}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else}}dashboard{{end}}">
  19. <img class="ui avatar image" src="{{.AvatarLink}}">
  20. {{.ShortName 20}}
  21. </a>
  22. {{end}}
  23. </div>
  24. <a class="item" href="{{AppSubUrl}}/org/create">
  25. <i class="octicon octicon-plus"></i>&nbsp;&nbsp;&nbsp;{{.i18n.Tr "new_org"}}
  26. </a>
  27. </div>
  28. </div>
  29. {{if .ContextUser.IsOrganization}}
  30. <div class="ui right">
  31. <div class="ui secondary head menu">
  32. <a class="{{if .PageIsNews}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/dashboard">
  33. <i class="octicon octicon-rss"></i>&nbsp;{{.i18n.Tr "activities"}}
  34. </a>
  35. <a class="{{if .PageIsIssues}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/issues">
  36. <i class="octicon octicon-issue-opened"></i>&nbsp;{{.i18n.Tr "issues"}}
  37. </a>
  38. <a class="{{if .PageIsPulls}}active{{end}} item" href="{{AppSubUrl}}/org/{{.ContextUser.Name}}/pulls">
  39. <i class="octicon octicon-git-pull-request"></i>&nbsp;{{.i18n.Tr "pull_requests"}}
  40. </a>
  41. <div class="right menu">
  42. <div class="item">
  43. <a class="ui blue basic button" href="{{.ContextUser.HomeLink}}">
  44. {{.i18n.Tr "home.view_home" (.ContextUser.ShortName 10)}}
  45. </a>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. {{end}}
  51. </div>
  52. <div class="ui divider"></div>