header.jade 3.9 KB

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