mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
broken free trial func into own file. added ab test on upgrade button colour
This commit is contained in:
parent
6c0f03e9c7
commit
02ef07dca4
9 changed files with 44 additions and 22 deletions
|
@ -25,8 +25,8 @@ script(type="text/ng-template", id="dropboxModalTemplate")
|
||||||
strong Dropbox/sharelatex/{{ project.name }}
|
strong Dropbox/sharelatex/{{ project.name }}
|
||||||
div.text-center(ng-hide="dbState.hasDropboxFeature")
|
div.text-center(ng-hide="dbState.hasDropboxFeature")
|
||||||
p #{translate("need_to_upgrade_for_dropbox")}
|
p #{translate("need_to_upgrade_for_dropbox")}
|
||||||
p
|
p(ng-controller="FreeTrialModalController")
|
||||||
a.btn.btn-info(ng-click="startFreeTrial('dropbox')") #{translate("start_free_trial")}
|
a.btn(ng-click="startFreeTrial('dropbox')", ng-class="buttonClass") #{translate("start_free_trial")}
|
||||||
p.small(ng-show="startedFreeTrial")
|
p.small(ng-show="startedFreeTrial")
|
||||||
| #{translate("refresh_page_after_starting_free_trial")}
|
| #{translate("refresh_page_after_starting_free_trial")}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ div.full-size.pdf(ng-controller="PdfController")
|
||||||
p
|
p
|
||||||
a.btn.btn-info(
|
a.btn.btn-info(
|
||||||
href
|
href
|
||||||
ng-click="startFreeTrial('compile-timeout')"
|
ng-click="hello('compile-timeout')"
|
||||||
) #{translate("start_free_trial")}
|
) #{translate("start_free_trial")}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
|
||||||
) #{translate("share")}
|
) #{translate("share")}
|
||||||
div.text-center(ng-hide="canAddCollaborators")
|
div.text-center(ng-hide="canAddCollaborators")
|
||||||
p #{translate("need_to_upgrade_for_more_collabs")}.
|
p #{translate("need_to_upgrade_for_more_collabs")}.
|
||||||
p
|
p(ng-controller="FreeTrialModalController")
|
||||||
a.btn.btn-info(href, ng-click="startFreeTrial('projectMembers')") #{translate("start_free_trial")}
|
a.btn(href, ng-click="startFreeTrial('projectMembers')", ng-class="buttonClass") #{translate("start_free_trial")}
|
||||||
p.small(ng-show="startedFreeTrial")
|
p.small(ng-show="startedFreeTrial")
|
||||||
| #{translate("refresh_page_after_starting_free_trial")}.
|
| #{translate("refresh_page_after_starting_free_trial")}.
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@ div#trackChanges(ng-show="ui.view == 'track-changes'")
|
||||||
.upgrade-prompt(ng-show="!project.features.versioning")
|
.upgrade-prompt(ng-show="!project.features.versioning")
|
||||||
.message(ng-show="project.owner._id == user.id")
|
.message(ng-show="project.owner._id == user.id")
|
||||||
p #{translate("need_to_upgrade_for_history")}
|
p #{translate("need_to_upgrade_for_history")}
|
||||||
p
|
p(ng-controller="FreeTrialModalController")
|
||||||
a.btn.btn-info(
|
a.btn(
|
||||||
href
|
href
|
||||||
|
ng-class="buttonClass"
|
||||||
ng-click="startFreeTrial('track-changes')"
|
ng-click="startFreeTrial('track-changes')"
|
||||||
) #{translate("start_free_trial")}
|
) #{translate("start_free_trial")}
|
||||||
p.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")}
|
p.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")}
|
||||||
|
|
|
@ -86,7 +86,7 @@ block content
|
||||||
Recurly.buildSubscriptionForm(recurlySubscriptionFormConfig);
|
Recurly.buildSubscriptionForm(recurlySubscriptionFormConfig);
|
||||||
|
|
||||||
window.ab = [
|
window.ab = [
|
||||||
{step:1, bucket:"eu-eu", testName:"multi_currency"},
|
{step:1, bucket:"red", testName:"button_color"},
|
||||||
{step:1, bucket:"eu-usd", testName:"multi_currency"}
|
{step:1, bucket:"blue", testName:"button_color"}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -37,4 +37,7 @@ block content
|
||||||
window.ab = [
|
window.ab = [
|
||||||
{step:1, bucket:"student_control", testName:"editor_plan"},
|
{step:1, bucket:"student_control", testName:"editor_plan"},
|
||||||
{step:1, bucket:"collab_test", testName:"editor_plan"},
|
{step:1, bucket:"collab_test", testName:"editor_plan"},
|
||||||
|
|
||||||
|
{step:2, bucket:"blue", testName:"button_color"},
|
||||||
|
{step:2, bucket:"red", testName:"button_color"}
|
||||||
]
|
]
|
|
@ -28,7 +28,7 @@ script(type="text/ng-template", id="BonusLinkToUsModal")
|
||||||
div.text-center(ng-hide="dbState.hasDropboxFeature")
|
div.text-center(ng-hide="dbState.hasDropboxFeature")
|
||||||
p You need to upgrade your account to link to dropbox.
|
p You need to upgrade your account to link to dropbox.
|
||||||
p
|
p
|
||||||
a.btn.btn-info(ng-click="startFreeTrial('dropbox')") Start Free Trial
|
a.btn(ng-click="startFreeTrial('dropbox')", ng-class="buttonClass") Start Free Trial
|
||||||
p.small(ng-show="startedFreeTrial")
|
p.small(ng-show="startedFreeTrial")
|
||||||
| Please refresh this page after starting your free trial.
|
| Please refresh this page after starting your free trial.
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ define [
|
||||||
"directives/rightClick"
|
"directives/rightClick"
|
||||||
"filters/formatDate"
|
"filters/formatDate"
|
||||||
"main/event-tracking"
|
"main/event-tracking"
|
||||||
|
"main/account-upgrade"
|
||||||
], (
|
], (
|
||||||
App
|
App
|
||||||
FileTreeManager
|
FileTreeManager
|
||||||
|
@ -38,7 +39,8 @@ define [
|
||||||
PdfManager
|
PdfManager
|
||||||
BinaryFilesManager
|
BinaryFilesManager
|
||||||
) ->
|
) ->
|
||||||
App.controller "IdeController", ($scope, $timeout, ide, abTestManager) ->
|
|
||||||
|
App.controller "IdeController", ($scope, $timeout, ide) ->
|
||||||
# Don't freak out if we're already in an apply callback
|
# Don't freak out if we're already in an apply callback
|
||||||
$scope.$originalApply = $scope.$apply
|
$scope.$originalApply = $scope.$apply
|
||||||
$scope.$apply = (fn = () ->) ->
|
$scope.$apply = (fn = () ->) ->
|
||||||
|
@ -64,17 +66,6 @@ define [
|
||||||
|
|
||||||
$scope.chat = {}
|
$scope.chat = {}
|
||||||
|
|
||||||
$scope.startFreeTrial = (source) ->
|
|
||||||
|
|
||||||
testBuckets = [
|
|
||||||
{ bucketName:"student_control", planName:"student"}
|
|
||||||
{ bucketName:"collab_test", planName:"collaborator"}
|
|
||||||
]
|
|
||||||
editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets
|
|
||||||
abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0)
|
|
||||||
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
|
||||||
window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}")
|
|
||||||
$scope.startedFreeTrial = true
|
|
||||||
|
|
||||||
window._ide = ide
|
window._ide = ide
|
||||||
|
|
||||||
|
|
27
services/web/public/coffee/main/account-upgrade.coffee
Normal file
27
services/web/public/coffee/main/account-upgrade.coffee
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
define [
|
||||||
|
"base"
|
||||||
|
], (App) ->
|
||||||
|
App.controller "FreeTrialModalController", ($scope, abTestManager)->
|
||||||
|
|
||||||
|
buttonColorBuckets = [
|
||||||
|
{ bucketName:"red", btnClass:"primary"}
|
||||||
|
{ bucketName:"blue", btnClass:"info"}
|
||||||
|
]
|
||||||
|
|
||||||
|
buttonColorBucket = abTestManager.getABTestBucket "button_color", buttonColorBuckets
|
||||||
|
abTestManager.processTestWithStep("button_color", buttonColorBucket.bucketName, 0)
|
||||||
|
$scope.buttonClass = "btn-#{buttonColorBucket.btnClass}"
|
||||||
|
|
||||||
|
|
||||||
|
$scope.startFreeTrial = (source) ->
|
||||||
|
|
||||||
|
testBuckets = [
|
||||||
|
{ bucketName:"student_control", planName:"student"}
|
||||||
|
{ bucketName:"collab_test", planName:"collaborator"}
|
||||||
|
]
|
||||||
|
|
||||||
|
editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets
|
||||||
|
abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0)
|
||||||
|
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
||||||
|
window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}")
|
||||||
|
$scope.startedFreeTrial = true
|
Loading…
Reference in a new issue