codecombat/app/views/modal/employer_signup_modal.coffee
2014-04-23 11:25:36 -07:00

31 lines
No EOL
985 B
CoffeeScript

View = require 'views/kinds/ModalView'
template = require 'templates/modal/employer_signup_modal'
module.exports = class EmployerSignupView extends View
id: "employer-signup"
template: template
closeButton: true
subscriptions:
'employer-linkedin-auth': 'showContractScreen'
constructor: (options) ->
super(options)
@authorizedWithLinkedIn = IN?.User?.isAuthorized()
window.contractCallback = -> window.Backbone.Mediator.publish("employer-linkedin-auth")
afterInsert: ->
super()
unless @authorizedWithLinkedIn
linkedInButtonParentElement = document.getElementById("linkedInAuthButton").parentNode
IN.parse(linkedInButtonParentElement) if linkedInButtonParentElement
showContractScreen: =>
@render()
getRenderData: ->
context = super()
context.userIsAuthorized = @authorizedWithLinkedIn
if @authorizedWithLinkedIn
context.firstName = application.linkedinHandler.linkedInData.firstName
context