context = window
teacherActions = window.JK.Actions.Teacher

@TeacherProfileMixin = {
  onAppInit: (app) ->
    logger.debug("TeacherProfile onAppInit", app, document.referrer)
    screenBindings = {
      'beforeShow': @beforeShow
    }

    logger.debug("Binding setup to: teachers/profile/#{@screenName()}")
    app.bindScreen("teachers/profile/#{@screenName()}", screenBindings)

  beforeShow: (data) ->
    logger.debug("TeacherProfile beforeShow", data, data.d)

    if data? && data.d?
      @teacherId = data.d
      teacherActions.load.trigger({teacher_id: @teacherId})
    else
      teacherActions.load.trigger({})
}