header.jade 4.5 KB

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