AccountTabContainer.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C) 2015 - 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. import React from 'react'
  19. import PropTypes from 'prop-types'
  20. import GradingStandardCollection from 'jsx/grading/gradingStandardCollection'
  21. import GradingPeriodSetCollection from 'jsx/grading/GradingPeriodSetCollection'
  22. import $ from 'jquery'
  23. import I18n from 'i18n!grading_periods'
  24. const { bool, string, shape } = PropTypes;
  25. class AccountTabContainer extends React.Component {
  26. static propTypes = {
  27. readOnly: bool.isRequired,
  28. urls: shape({
  29. gradingPeriodSetsURL: string.isRequired,
  30. gradingPeriodsUpdateURL: string.isRequired,
  31. enrollmentTermsURL: string.isRequired,
  32. deleteGradingPeriodURL: string.isRequired
  33. }).isRequired,
  34. }
  35. componentDidMount () {
  36. $(this.tabContainer).children('.ui-tabs-minimal').tabs();
  37. }
  38. render () {
  39. return (
  40. <div ref={(el) => { this.tabContainer = el; }}>
  41. <h1>{I18n.t('Grading')}</h1>
  42. <div className="ui-tabs-minimal">
  43. <ul>
  44. <li><a href="#grading-periods-tab" className="grading_periods_tab"> {I18n.t('Grading Periods')}</a></li>
  45. <li><a href="#grading-standards-tab" className="grading_standards_tab"> {I18n.t('Grading Schemes')}</a></li>
  46. </ul>
  47. <div
  48. ref={(el) => { this.gradingPeriods = el; }}
  49. id="grading-periods-tab"
  50. >
  51. <GradingPeriodSetCollection
  52. urls={this.props.urls}
  53. readOnly={this.props.readOnly}
  54. />
  55. </div>
  56. <div
  57. ref={(el) => { this.gradingStandards = el; }}
  58. id="grading-standards-tab"
  59. >
  60. <GradingStandardCollection />
  61. </div>
  62. </div>
  63. </div>
  64. );
  65. }
  66. }
  67. export default AccountTabContainer