فهرست منبع

When upgrading track changes on V2, redirect to V1 trial page

Alasdair Smith 8 سال پیش
والد
کامیت
f5c914ed6c
2فایلهای تغییر یافته به همراه11 افزوده شده و 4 حذف شده
  1. 4 0
      services/web/app/views/layout.pug
  2. 7 4
      services/web/public/coffee/main/account-upgrade.coffee

+ 4 - 0
services/web/app/views/layout.pug

@@ -95,6 +95,10 @@ html(itemscope, itemtype='http://schema.org/Product')
 					cdnDomain : '!{settings.templates.cdnDomain}',
 					indexName : '!{settings.templates.indexName}'
 				}
+
+		- if (settings.overleaf && settings.overleaf.host)
+			script.
+				window.v1BaseUrl = '!{settings.overleaf.host}'
 				
 	body
 		if(settings.recaptcha)

+ 7 - 4
services/web/public/coffee/main/account-upgrade.coffee

@@ -11,9 +11,12 @@ define [
 			w = window.open()
 			go = () ->
 				ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
-				url = "/user/subscription/new?planCode=#{plan}&ssp=true"
-				if couponCode?
-					url = "#{url}&cc=#{couponCode}"
+				if window.v1BaseUrl?
+					url = "#{window.v1BaseUrl}/users/trial"
+				else
+					url = "/user/subscription/new?planCode=#{plan}&ssp=true"
+					if couponCode?
+						url = "#{url}&cc=#{couponCode}"
 				$scope.startedFreeTrial = true
 
 				switch source
@@ -27,7 +30,7 @@ define [
 
 					else
 						event_tracking.sendMB "subscription-start-trial", { source, plan }
-				
+
 				w.location = url
 
 			if $scope.shouldABTestPlans