header.jade 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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
  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. span
  35. a(href="{{pathFor 'home'}}")
  36. span.fa.fa-home
  37. | {{_ 'all-boards'}}
  38. ul
  39. //li
  40. // a(href="{{pathFor 'public'}}")
  41. // span.fa.fa-globe
  42. // | {{_ 'public'}}
  43. each currentUser.starredBoards
  44. li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
  45. a(href="{{pathFor 'board' id=_id slug=slug}}")
  46. = title
  47. else
  48. li.current {{_ 'quick-access-description'}}
  49. // Next line is used only for spacing at header,
  50. // there is no visible clickable icon.
  51. #header-new-board-icon
  52. // Hide duplicate create board button,
  53. // because it did not show board templates correctly.
  54. //a#header-new-board-icon.js-create-board
  55. // i.fa.fa-plus(title="Create a new board")
  56. +notifications
  57. +headerUserBar
  58. #header(class=currentBoard.colorClass)
  59. //-
  60. The main bar is a colorful bar that provide all the meta-data for the
  61. current page. This bar is contextual based.
  62. If the user is not connected we display "sign in" and "log in" buttons.
  63. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  64. +Template.dynamic(template=headerBar)
  65. if appIsOffline
  66. +offlineWarning
  67. if currentUser.isBoardMember
  68. if hasAnnouncement
  69. .announcement
  70. p
  71. i.fa.fa-bullhorn
  72. +viewer
  73. | #{announcement}
  74. i.fa.fa-times-circle.js-close-announcement
  75. template(name="offlineWarning")
  76. .offline-warning
  77. p
  78. i.fa.fa-warning
  79. | {{_ 'app-is-offline'}}