header.jade 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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(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. a.js-toggle-desktop-drag-handles(title="{{_ 'show-desktop-drag-handles'}}" alt="{{_ 'show-desktop-drag-handles'}}")
  65. i.fa.fa-arrows
  66. if isShowDesktopDragHandles
  67. i.fa.fa-check-square-o
  68. unless isShowDesktopDragHandles
  69. i.fa.fa-ban
  70. // Next line is used only for spacing at header,
  71. // there is no visible clickable icon.
  72. #header-new-board-icon
  73. // Hide duplicate create board button,
  74. // because it did not show board templates correctly.
  75. //a#header-new-board-icon.js-create-board
  76. // i.fa.fa-plus(title="Create a new board")
  77. +notifications
  78. if currentSetting.customHelpLinkUrl
  79. #header-help
  80. a(href="{{currentSetting.customHelpLinkUrl}}", title="{{_ 'help'}}", target="_blank", rel="noopener noreferrer")
  81. span.fa.fa-question
  82. +headerUserBar
  83. #header(class=currentBoard.colorClass)
  84. //-
  85. The main bar is a colorful bar that provide all the meta-data for the
  86. current page. This bar is contextual based.
  87. If the user is not connected we display "sign in" and "log in" buttons.
  88. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  89. +Template.dynamic(template=headerBar)
  90. if appIsOffline
  91. +offlineWarning
  92. if currentUser.isBoardMember
  93. if hasAnnouncement
  94. .announcement
  95. p
  96. i.fa.fa-bullhorn
  97. +viewer
  98. | #{announcement}
  99. i.fa.fa-times-circle.js-close-announcement
  100. template(name="offlineWarning")
  101. .offline-warning
  102. p
  103. i.fa.fa-warning
  104. | {{_ 'app-is-offline'}}
  105. a.app-try-reconnect {{_ 'app-try-reconnect'}}