dashboard_header.mustache 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{!
  2. * Copyright (C) 2017 - present Instructure, Inc.
  3. *
  4. * This file is part of Canvas.
  5. *
  6. * Canvas is free software: you can redistribute it and/or modify it under
  7. * the terms of the GNU Affero General Public License as published by the Free
  8. * Software Foundation, version 3 of the License.
  9. *
  10. * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. * details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License along
  16. * with this program. If not, see <http://www.gnu.org/licenses/>.
  17. }}
  18. <div class="ic-Dashboard-header__layout">
  19. <h1 class="ic-Dashboard-header__title">{{#t}}Dashboard{{/t}}</h1>
  20. <div class="ic-Dashboard-header__actions">
  21. {{#planner_enabled}}
  22. <div
  23. id="dashboard-planner-header"
  24. class="CanvasPlanner__HeaderContainer"
  25. style={{ display: (this.props.planner_selected) ? 'block' : 'none' }}
  26. />
  27. {{/planner_enabled}}
  28. {{#menu_enabled}}
  29. <div id="DashboardOptionsMenu_Container">
  30. <DashboardOptionsMenu
  31. recent_activity_dashboard={this.props.recent_activity_dashboard}
  32. hide_dashcard_color_overlays={this.props.hide_dashcard_color_overlays}
  33. planner_enabled={this.props.planner_enabled}
  34. planner_selected={this.props.planner_selected}
  35. onDashboardChange={(newDashboard) => {
  36. this.setState({ currentDashboard: newDashboard }, function afterDashboardChange () {
  37. if (this.state.currentDashboard === 'planner') {
  38. document.body.classList.add('dashboard-is-planner');
  39. } else if (document.body.classList.contains('dashboard-is-planner')) {
  40. document.body.classList.remove('dashboard-is-planner');
  41. }
  42. });
  43. }}
  44. />
  45. </div>
  46. {{/menu_enabled}}
  47. </div>
  48. </div>