mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
18 lines
653 B
CoffeeScript
18 lines
653 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.controller "FreeTrialModalController", ($scope, abTestManager, sixpack, event_tracking)->
|
|
|
|
$scope.buttonClass = "btn-primary"
|
|
|
|
$scope.startFreeTrial = (source, couponCode) ->
|
|
event_tracking.sendMB "subscription-start-trial", { source, plan: $scope.startTrialPlanCode }
|
|
|
|
w = window.open()
|
|
sixpack.convert "track-changes-discount", ->
|
|
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
|
url = "/user/subscription/new?planCode=#{$scope.startTrialPlanCode}&ssp=true"
|
|
if couponCode?
|
|
url = "#{url}&cc=#{couponCode}"
|
|
$scope.startedFreeTrial = true
|
|
w.location = url
|