mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
d5a7514923
Squashed commits: [45c2237] Add a `subscription-form-switch-to-student` event [1ad9b8f] change experiment name, and re-enable switch-to-student workflow [f7cdb78] Remove debug [4b9778a] Incorporate collaborator alternative plans [701e80b] Add collaborator plans for heron and ibis [287aa0f] AB test plans from editor page [c74052e] Fix change-plan view for default plans [1a947d6] Use correct plan codes [1eecda7] Adjust prices [69c4c7b] Introduce two plans [8b8d5f8] Rename sixpack experiment [c332002] Fix up the change-plan page [c7af52d] Overhaul change-plan page, show only plans from current generation [33d86bf] update plan [5bbd946] Add a basic plans AB test
18 lines
620 B
CoffeeScript
18 lines
620 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 }
|
|
|
|
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
|