header.jade 3.9 KB

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