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

Use freeTrialBaseUrl instead of potentially fragile v1BaseUrl

Alasdair Smith 8 лет назад
Родитель
Сommit
7322522323

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

@@ -98,7 +98,10 @@ html(itemscope, itemtype='http://schema.org/Product')
 
 		- if (settings.overleaf && settings.overleaf.host)
 			script.
-				window.v1BaseUrl = '!{settings.overleaf.host}'
+				window.freeTrialBaseUrl = '!{settings.overleaf.host}/users/trial'
+		- else
+			script.
+				window.freeTrialBaseUrl = '/user/subscription/new'
 				
 	body
 		if(settings.recaptcha)

+ 3 - 6
services/web/public/coffee/main/account-upgrade.coffee

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