header.jade 3.9 KB

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