44 lines
1.1 KiB
CoffeeScript
44 lines
1.1 KiB
CoffeeScript
context = window
|
|
teacherActions = window.JK.Actions.Teacher
|
|
SessionActions = @SessionActions
|
|
ProfileActions = @ProfileActions
|
|
|
|
@TeacherSetupNav = React.createClass({
|
|
|
|
navBack: (e) ->
|
|
e.preventDefault();
|
|
console.log("navBack this.props", this.state, this.props)
|
|
this.props.handleNav({direction: "back"})
|
|
|
|
navCancel: (e) ->
|
|
ProfileActions.cancelTeacherEdit()
|
|
|
|
navNext: (e) ->
|
|
e.preventDefault()
|
|
console.log("navNext this.props", this.state, this.props)
|
|
this.props.handleNav({direction: "next"})
|
|
|
|
render: () ->
|
|
if window.ProfileStore.solo
|
|
saveText = 'SAVE & RETURN TO PROFILE'
|
|
else
|
|
if @props.last
|
|
saveText = 'SAVE & FINISH'
|
|
else
|
|
saveText = 'SAVE & NEXT'
|
|
|
|
if !this.props.hideBack && !window.ProfileStore.solo
|
|
back = `<a className="nav-button button-grey" onClick={this.navBack}>
|
|
BACK
|
|
</a>`
|
|
|
|
`<div className="TeacherSetupNav right">
|
|
<a className="nav-button button-grey" onClick={this.navCancel}>
|
|
CANCEL
|
|
</a>
|
|
{back}
|
|
<a className="nav-button button-orange" onClick={this.navNext}>
|
|
{saveText}
|
|
</a>
|
|
</div>`
|
|
}) |