navbar.tmpl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.Name}}
  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}}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}}pulls{{end}}">
  19. <img class="ui avatar image" src="{{.AvatarLink}}">
  20. {{.Name}}
  21. </a>
  22. {{end}}
  23. </div>
  24. <a class="item" href="{{AppSubUrl}}/org/create">
  25. <i class="octicon octicon-repo-create"></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 "news_feed"}}
  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="{{AppSubUrl}}/org/{{.ContextUser.Name}}">
  44. {{.i18n.Tr "home.view_home" .ContextUser.Name}}
  45. </a>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. {{end}}
  51. </div>
  52. <div class="ui divider"></div>