Просмотр исходного кода

added ab test to show collar plan to people in editor

Henry Oswald 12 лет назад
Родитель
Сommit
6c0f03e9c7

+ 1 - 0
services/web/app/coffee/Features/Subscription/SubscriptionController.coffee

@@ -57,6 +57,7 @@ module.exports = SubscriptionController =
 								plan_code: req.query.planCode
 								currency: currency
 								plan:plan
+								showStudentPlan: req.query.ssp
 								recurlyConfig: JSON.stringify
 									currency: currency
 									subdomain: Settings.apis.recurly.subdomain

+ 6 - 0
services/web/app/views/subscriptions/new.jade

@@ -34,6 +34,12 @@ block content
 						
 				
 				.col-md-3.col-md-pull-6
+					if showStudentPlan == 'true'
+						a.btn-primary.btn.plansPageStudentLink(
+							href,
+							ng-click="switchToStudent()"
+						) #{translate("half_price_student")} 
+
 					.card.card-first
 						.paymentPageFeatures
 							.page-header

+ 2 - 7
services/web/app/views/subscriptions/successful_subscription.jade

@@ -35,11 +35,6 @@ block content
 
 	script(type="text/javascript").
 		window.ab = [
-			{step:2, bucket:"eu-eu", testName:"multi_currency"},
-			{step:2, bucket:"eu-usd", testName:"multi_currency"},
-
-			{step:1, bucket:"eu-eu", testName:"multi_currency_editor"},
-			{step:1, bucket:"eu-usd", testName:"multi_currency_editor"}
-
-
+			{step:1, bucket:"student_control", testName:"editor_plan"},
+			{step:1, bucket:"collab_test", testName:"editor_plan"},
 		]

+ 9 - 2
services/web/public/coffee/ide.coffee

@@ -65,10 +65,17 @@ define [
 		$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=student_free_trial_7_days")
+			window.open("/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}")
 			$scope.startedFreeTrial = true
-
+		
 		window._ide = ide
 
 		ide.project_id = $scope.project_id = window.project_id

+ 4 - 1
services/web/public/coffee/main/new-subscription.coffee

@@ -8,4 +8,7 @@ define [
 		$scope.plans = MultiCurrencyPricing.plans
 
 		$scope.changeCurrency = (newCurrency)->
-			window.location = "/user/subscription/new?planCode=#{window.plan_code}&currency=#{newCurrency}"
+			window.location = "/user/subscription/new?planCode=#{window.plan_code}&currency=#{newCurrency}"
+
+		$scope.switchToStudent = ()->
+			window.location = "/user/subscription/new?planCode=student&currency=#{$scope.currencyCode}"

+ 5 - 0
services/web/public/stylesheets/app/plans.less

@@ -91,6 +91,11 @@
 	}
 }
 
+.plansPageStudentLink {
+	margin-left: 20px;
+	margin-top: 20px;
+}
+