2015-11-29 10:02:45 -05:00
|
|
|
AuthModal = require 'views/core/AuthModal'
|
2014-11-28 20:49:41 -05:00
|
|
|
RootView = require 'views/core/RootView'
|
2014-01-03 13:32:13 -05:00
|
|
|
template = require 'templates/teachers'
|
|
|
|
|
2014-07-17 20:16:32 -04:00
|
|
|
module.exports = class TeachersView extends RootView
|
2014-06-30 22:16:26 -04:00
|
|
|
id: 'teachers-view'
|
2014-01-03 13:32:13 -05:00
|
|
|
template: template
|
2015-11-29 10:02:45 -05:00
|
|
|
|
|
|
|
events:
|
|
|
|
'click .btn-create-account': 'onClickSignup'
|
|
|
|
'click .btn-login-account': 'onClickLogin'
|
|
|
|
'click .link-register': 'onClickSignup'
|
|
|
|
|
2015-12-02 16:23:07 -05:00
|
|
|
constructor: ->
|
|
|
|
super()
|
|
|
|
unless me.isAnonymous()
|
|
|
|
_.defer ->
|
|
|
|
application.router.navigate "/courses/teachers", trigger: true
|
|
|
|
|
2015-11-29 10:02:45 -05:00
|
|
|
onClickLogin: (e) ->
|
|
|
|
@openModalView new AuthModal(mode: 'login') if me.get('anonymous')
|
|
|
|
|
|
|
|
onClickSignup: (e) ->
|
|
|
|
@openModalView new AuthModal() if me.get('anonymous')
|