header.jade 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. a.js-toggle-desktop-drag-handles(title="{{_ 'show-desktop-drag-handles'}}" alt="{{_ 'show-desktop-drag-handles'}}")
  27. i.fa.fa-arrows
  28. if isShowDesktopDragHandles
  29. i.fa.fa-check-square-o
  30. unless isShowDesktopDragHandles
  31. i.fa.fa-ban
  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(
  43. src="{{currentSetting.customTopLeftCornerLogoImageUrl}}"
  44. alt="{{currentSetting.productName}} logo"
  45. title="{{currentSetting.productName}}"
  46. )
  47. unless currentSetting.customTopLeftCornerLogoLinkUrl
  48. 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}}")
  49. unless currentSetting.customTopLeftCornerLogoImageUrl
  50. div#headerIsSettingDatabaseCallDone
  51. img(
  52. src="{{pathFor '/logo-header.png'}}"
  53. alt="{{currentSetting.productName}} logo"
  54. title="{{currentSetting.productName}}"
  55. )
  56. span.allBoards
  57. a(href="{{pathFor 'home'}}")
  58. span.fa.fa-home
  59. | {{_ 'all-boards'}}
  60. ul.header-quick-access-list
  61. //li
  62. // a(href="{{pathFor 'public'}}")
  63. // span.fa.fa-globe
  64. // | {{_ 'public'}}
  65. each currentUser.starredBoards
  66. li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
  67. a(href="{{pathFor 'board' id=_id slug=slug}}")
  68. +viewer
  69. = title
  70. else
  71. li.current.empty {{_ 'quick-access-description'}}
  72. a.js-toggle-desktop-drag-handles(title="{{_ 'show-desktop-drag-handles'}}" alt="{{_ 'show-desktop-drag-handles'}}")
  73. i.fa.fa-arrows
  74. if isShowDesktopDragHandles
  75. i.fa.fa-check-square-o
  76. unless isShowDesktopDragHandles
  77. i.fa.fa-ban
  78. // Next line is used only for spacing at header,
  79. // there is no visible clickable icon.
  80. #header-new-board-icon
  81. // Hide duplicate create board button,
  82. // because it did not show board templates correctly.
  83. //a#header-new-board-icon.js-create-board
  84. button.add-card(aria-label="Add card" title="Add card")
  85. i.fa.fa-plus
  86. +notifications
  87. if currentSetting.customHelpLinkUrl
  88. #header-help
  89. a(href="{{currentSetting.customHelpLinkUrl}}", title="{{_ 'help'}}", target="_blank", rel="noopener noreferrer")
  90. span.fa.fa-question
  91. +headerUserBar
  92. #header(class=currentBoard.colorClass)
  93. //-
  94. The main bar is a colorful bar that provide all the meta-data for the
  95. current page. This bar is contextual based.
  96. If the user is not connected we display "sign in" and "log in" buttons.
  97. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  98. +Template.dynamic(template=headerBar)
  99. if appIsOffline
  100. +offlineWarning
  101. if currentUser.isBoardMember
  102. if hasAnnouncement
  103. .announcement
  104. p
  105. i.fa.fa-bullhorn
  106. +viewer
  107. | #{announcement}
  108. i.fa.fa-times-circle.js-close-announcement
  109. template(name="offlineWarning")
  110. .offline-warning
  111. p
  112. i.fa.fa-warning
  113. | {{_ 'app-is-offline'}}
  114. a.app-try-reconnect {{_ 'app-try-reconnect'}}