header.jade 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. // Home icon - always at left side of logo
  10. span.home-icon.allBoards
  11. a(href="{{pathFor 'home'}}")
  12. span.fa.fa-home
  13. | {{_ 'all-boards'}}
  14. // Logo - always visible in desktop mode
  15. unless currentSetting.hideLogo
  16. if currentSetting.customTopLeftCornerLogoImageUrl
  17. if currentSetting.customTopLeftCornerLogoLinkUrl
  18. a(href="{{currentSetting.customTopLeftCornerLogoLinkUrl}}" alt="{{currentSetting.productName}}" title="{{currentSetting.productName}}")
  19. img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0")
  20. unless currentSetting.customTopLeftCornerLogoLinkUrl
  21. 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}}")
  22. unless currentSetting.customTopLeftCornerLogoImageUrl
  23. div#headerIsSettingDatabaseCallDone
  24. img(src="{{pathFor '/logo-header.png'}}" alt="{{currentSetting.productName}}" title="{{currentSetting.productName}}")
  25. // Zoom controls - always visible
  26. .zoom-controls
  27. span.zoom-level.js-zoom-level-click(title="{{_ 'click-to-change-zoom'}}")
  28. span.zoom-display {{zoomLevel}}%
  29. input.zoom-input.js-zoom-input(type="number" value=zoomLevel min="50" max="300" step="10" style="display: none;")
  30. if isMiniScreen
  31. ul.header-quick-access-list
  32. if currentList
  33. each currentBoard.lists
  34. li(class="{{#if $.Session.equals 'currentList' _id}}current{{/if}}")
  35. a.js-select-list
  36. +viewer
  37. = title
  38. else
  39. each currentUser.starredBoards
  40. li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
  41. a(href="{{pathFor 'board' id=_id slug=slug}}")
  42. +viewer
  43. = title
  44. //a.js-toggle-desktop-drag-handles(title="{{_ 'show-desktop-drag-handles'}}" alt="{{_ 'show-desktop-drag-handles'}}")
  45. // i.fa.fa-arrows
  46. // if isShowDesktopDragHandles
  47. // i.fa.fa-check-square-o
  48. // unless isShowDesktopDragHandles
  49. // i.fa.fa-ban
  50. #header-new-board-icon
  51. else
  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. .mobile-mode-toggle
  78. a.board-header-btn.js-mobile-mode-toggle(title="{{_ 'mobile-desktop-toggle'}}" class="{{#if mobileMode}}mobile-active{{else}}desktop-active{{/if}}")
  79. i.fa.fa-mobile.mobile-icon(class="{{#if mobileMode}}active{{/if}}")
  80. i.fa.fa-desktop.desktop-icon(class="{{#unless mobileMode}}active{{/unless}}")
  81. +notifications
  82. if currentSetting.customHelpLinkUrl
  83. #header-help
  84. a(href="{{currentSetting.customHelpLinkUrl}}", title="{{_ 'help'}}", target="_blank", rel="noopener noreferrer")
  85. span.fa.fa-question
  86. +headerUserBar
  87. #header(class=currentBoard.colorClass)
  88. //-
  89. The main bar is a colorful bar that provide all the meta-data for the
  90. current page. This bar is contextual based.
  91. If the user is not connected we display "sign in" and "log in" buttons.
  92. #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
  93. +Template.dynamic(template=headerBar)
  94. if appIsOffline
  95. +offlineWarning
  96. if currentUser.isBoardMember
  97. if hasAnnouncement
  98. .announcement
  99. p
  100. i.fa.fa-bullhorn
  101. +viewer
  102. | #{announcement}
  103. i.fa.fa-times-circle.js-close-announcement
  104. template(name="offlineWarning")
  105. .offline-warning
  106. p
  107. i.fa.fa-warning
  108. | {{_ 'app-is-offline'}}
  109. a.app-try-reconnect {{_ 'app-try-reconnect'}}