header.jade 4.0 KB

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