header.jade 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. template(name="header")
  2. //-
  3. If the user is connected we display a small "quick-access" top bar that
  4. list all starred boards with a link to go there. This is inspired by the
  5. Reddit "subreddit" bar.
  6. The first link goes to the boards page.
  7. if currentUser
  8. #header-quick-access(class=currentBoard.colorClass)
  9. if isMiniScreen
  10. ul
  11. li
  12. a(href="{{pathFor 'home'}}")
  13. span.fa.fa-home
  14. if currentList
  15. each currentBoard.lists
  16. li(class="{{#if $.Session.equals 'currentList' _id}}current{{/if}}")
  17. a.js-select-list
  18. = title
  19. #header-new-board-icon
  20. else
  21. //-
  22. On sandstorm, the logo shouldn't be clickable, because we only have one
  23. page/document on it, and we don't want to see the home page containing
  24. the list of all boards.
  25. unless currentSetting.hideLogo
  26. if currentSetting.customTopLeftCornerLogoImageUrl
  27. if currentSetting.customTopLeftCornerLogoLinkUrl
  28. a(href="{{currentSetting.customTopLeftCornerLogoLinkUrl}}")
  29. img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0")
  30. unless currentSetting.customTopLeftCornerLogoLinkUrl
  31. img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0")
  32. unless currentSetting.customTopLeftCornerLogoImageUrl
  33. img(src="{{pathFor '/logo-header.png'}}" alt="")
  34. ul
  35. li
  36. a(href="{{pathFor 'home'}}")
  37. span.fa.fa-home
  38. | {{_ 'all-boards'}}
  39. li.separator -
  40. //li
  41. // a(href="{{pathFor 'public'}}")
  42. // span.fa.fa-globe
  43. // | {{_ 'public'}}
  44. each currentUser.starredBoards
  45. li.separator -
  46. li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
  47. a(href="{{pathFor 'board' id=_id slug=slug}}")
  48. = title
  49. else
  50. li.current {{_ 'quick-access-description'}}
  51. // Next line is used only for spacing at header,
  52. // there is no visible clickable icon.
  53. #header-new-board-icon
  54. // Hide duplicate create board button,
  55. // because it did not show board templates correctly.
  56. //a#header-new-board-icon.js-create-board
  57. // i.fa.fa-plus(title="Create a new board")
  58. +notifications
  59. +headerUserBar
  60. #header(class=currentBoard.colorClass)
  61. //-
  62. The main bar is a colorful bar that provide all the meta-data for the
  63. current page. This bar is contextual based.
  64. If the user is not connected we display "sign in" and "log in" buttons.
  65. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  66. +Template.dynamic(template=headerBar)
  67. if appIsOffline
  68. +offlineWarning
  69. if currentUser.isBoardMember
  70. if hasAnnouncement
  71. .announcement
  72. p
  73. i.fa.fa-bullhorn
  74. +viewer
  75. | #{announcement}
  76. i.fa.fa-times-circle.js-close-announcement
  77. template(name="offlineWarning")
  78. .offline-warning
  79. p
  80. i.fa.fa-warning
  81. | {{_ 'app-is-offline'}}