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'
|
2016-02-25 18:24:16 -05:00
|
|
|
CreateAccountModal = require 'views/core/CreateAccountModal'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
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()
|
2015-12-21 18:02:11 -05:00
|
|
|
if me.isAnonymous()
|
|
|
|
_.defer ->
|
|
|
|
# Just go to /schools for now, that page is better than this one. TODO: figure out real URLs/flow/content.
|
|
|
|
application.router.navigate "/schools", trigger: true
|
2015-12-02 16:23:07 -05:00
|
|
|
unless me.isAnonymous()
|
|
|
|
_.defer ->
|
2016-03-30 19:20:37 -04:00
|
|
|
application.router.navigate "/teachers/courses", trigger: true
|
2015-12-02 16:23:07 -05:00
|
|
|
|
2015-11-29 10:02:45 -05:00
|
|
|
onClickLogin: (e) ->
|
2016-02-25 18:24:16 -05:00
|
|
|
@openModalView new AuthModal() if me.get('anonymous')
|
2015-12-02 20:10:19 -05:00
|
|
|
window.tracker?.trackEvent 'Started Signup', category: 'Teachers', label: 'Teachers Login'
|
2015-11-29 10:02:45 -05:00
|
|
|
|
|
|
|
onClickSignup: (e) ->
|
2016-02-25 18:24:16 -05:00
|
|
|
@openModalView new CreateAccountModal() if me.get('anonymous')
|
2015-12-02 20:10:19 -05:00
|
|
|
window.tracker?.trackEvent 'Started Signup', category: 'Teachers', label: 'Teachers Create'
|
2015-12-18 13:02:03 -05:00
|
|
|
|
|
|
|
logoutRedirectURL: false
|