2015-12-15 09:20:54 -05:00
|
|
|
app = require 'core/application'
|
2015-12-14 23:43:34 -05:00
|
|
|
AuthModal = require 'views/core/AuthModal'
|
|
|
|
RootView = require 'views/core/RootView'
|
|
|
|
template = require 'templates/sales-view'
|
|
|
|
|
|
|
|
module.exports = class SalesView extends RootView
|
|
|
|
id: 'sales-view'
|
|
|
|
template: template
|
|
|
|
|
|
|
|
events:
|
2015-12-15 09:20:54 -05:00
|
|
|
'click .btn-contact-us': 'onClickContactUs'
|
2015-12-14 23:43:34 -05:00
|
|
|
'click .btn-create-account': 'onClickSignup'
|
|
|
|
'click .btn-login-account': 'onClickLogin'
|
2015-12-21 16:00:39 -05:00
|
|
|
'click #down-arrow': 'onClickDownArrow'
|
2015-12-14 23:43:34 -05:00
|
|
|
|
|
|
|
getTitle: ->
|
|
|
|
'CodeCombat'
|
|
|
|
|
2015-12-15 09:20:54 -05:00
|
|
|
onClickContactUs: (e) ->
|
2016-01-21 17:41:57 -05:00
|
|
|
app.router.navigate '/teachers/quote', trigger: true
|
2015-12-15 09:20:54 -05:00
|
|
|
|
2015-12-14 23:43:34 -05:00
|
|
|
onClickLogin: (e) ->
|
|
|
|
@openModalView new AuthModal(mode: 'login') if me.get('anonymous')
|
2016-01-21 13:42:56 -05:00
|
|
|
window.tracker?.trackEvent 'Started Login', category: 'Sales', label: 'Sales Login', ['Mixpanel']
|
2015-12-14 23:43:34 -05:00
|
|
|
|
|
|
|
onClickSignup: (e) ->
|
|
|
|
@openModalView new AuthModal() if me.get('anonymous')
|
2016-01-21 13:42:56 -05:00
|
|
|
window.tracker?.trackEvent 'Started Signup', category: 'Sales', label: 'Sales Create', ['Mixpanel']
|
2015-12-18 13:02:03 -05:00
|
|
|
|
|
|
|
logoutRedirectURL: false
|
2015-12-21 16:00:39 -05:00
|
|
|
|
|
|
|
onClickDownArrow: (e) ->
|
|
|
|
$('#page-container').animate({
|
|
|
|
scrollTop: $('[name="' + $(e.target).closest('a').attr('href').substr(1) + '"]').offset().top
|
|
|
|
}, 300)
|
|
|
|
false
|
2016-02-02 15:48:19 -05:00
|
|
|
|
|
|
|
constructor: ->
|
|
|
|
super arguments...
|
|
|
|
me.setRole 'teacher'
|