header.jade 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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="27" width="auto" margin="0" padding="0")
  30. unless currentSetting.customTopLeftCornerLogoLinkUrl
  31. img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="27" 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. a#header-new-board-icon.js-create-board
  52. i.fa.fa-plus(title="Create a new board")
  53. +notifications
  54. +headerUserBar
  55. #header(class=currentBoard.colorClass)
  56. //-
  57. The main bar is a colorful bar that provide all the meta-data for the
  58. current page. This bar is contextual based.
  59. If the user is not connected we display "sign in" and "log in" buttons.
  60. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  61. +Template.dynamic(template=headerBar)
  62. if appIsOffline
  63. +offlineWarning
  64. if currentUser.isBoardMember
  65. if hasAnnouncement
  66. .announcement
  67. p
  68. i.fa.fa-bullhorn
  69. +viewer
  70. | #{announcement}
  71. i.fa.fa-times-circle.js-close-announcement
  72. template(name="offlineWarning")
  73. .offline-warning
  74. p
  75. i.fa.fa-warning
  76. | {{_ 'app-is-offline'}}