2014-07-08 11:02:26 +00:00
|
|
|
define [
|
|
|
|
"base"
|
2014-09-04 18:03:04 +00:00
|
|
|
"libs/recurly-3.0.5"
|
|
|
|
], (App, recurly) ->
|
2014-09-05 14:47:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
App.factory "MultiCurrencyPricing", () ->
|
|
|
|
|
2014-10-13 13:10:15 +00:00
|
|
|
currencyCode = window.recomendedCurrency
|
2014-07-21 10:33:10 +00:00
|
|
|
|
2014-10-13 15:13:31 +00:00
|
|
|
return {
|
|
|
|
currencyCode:currencyCode
|
|
|
|
plans:
|
|
|
|
USD:
|
|
|
|
symbol: "$"
|
|
|
|
student:
|
|
|
|
monthly: "$8"
|
|
|
|
annual: "$80"
|
|
|
|
collaborator:
|
|
|
|
monthly: "$15"
|
|
|
|
annual: "$180"
|
|
|
|
professional:
|
|
|
|
monthly: "$30"
|
|
|
|
annual: "$360"
|
|
|
|
|
|
|
|
EUR:
|
|
|
|
symbol: "€"
|
|
|
|
student:
|
|
|
|
monthly: "€7"
|
|
|
|
annual: "€70"
|
|
|
|
collaborator:
|
2014-10-15 15:21:45 +00:00
|
|
|
monthly: "€14"
|
|
|
|
annual: "€168"
|
2014-10-13 15:13:31 +00:00
|
|
|
professional:
|
2014-10-15 15:21:45 +00:00
|
|
|
monthly: "€28"
|
|
|
|
annual: "€336"
|
2014-10-13 15:13:31 +00:00
|
|
|
|
|
|
|
GBP:
|
|
|
|
symbol: "£"
|
|
|
|
student:
|
|
|
|
monthly: "£6"
|
|
|
|
annual: "£60"
|
|
|
|
collaborator:
|
2014-10-15 15:21:45 +00:00
|
|
|
monthly: "£12"
|
|
|
|
annual: "£144"
|
2014-10-13 15:13:31 +00:00
|
|
|
professional:
|
2014-10-15 15:21:45 +00:00
|
|
|
monthly: "£24"
|
|
|
|
annual: "£288"
|
2014-11-19 14:52:59 +00:00
|
|
|
|
|
|
|
SEK:
|
|
|
|
symbol: "kr"
|
|
|
|
student:
|
|
|
|
monthly: "60 kr"
|
|
|
|
annual: "600 kr"
|
|
|
|
collaborator:
|
|
|
|
monthly: "110 kr"
|
|
|
|
annual: "1320 kr"
|
|
|
|
professional:
|
|
|
|
monthly: "220 kr"
|
|
|
|
annual: "2640 kr"
|
|
|
|
CAD:
|
|
|
|
symbol: "$"
|
|
|
|
student:
|
|
|
|
monthly: "$9"
|
|
|
|
annual: "$90"
|
|
|
|
collaborator:
|
|
|
|
monthly: "$17"
|
|
|
|
annual: "$204"
|
|
|
|
professional:
|
|
|
|
monthly: "$34"
|
|
|
|
annual: "$408"
|
2014-11-19 21:34:01 +00:00
|
|
|
|
|
|
|
NOK:
|
|
|
|
symbol: "kr"
|
|
|
|
student:
|
|
|
|
monthly: "60 kr"
|
|
|
|
annual: "600 kr"
|
|
|
|
collaborator:
|
|
|
|
monthly: "110 kr"
|
|
|
|
annual: "1320 kr"
|
|
|
|
professional:
|
|
|
|
monthly: "220 kr"
|
|
|
|
annual: "2640 kr"
|
|
|
|
|
|
|
|
DKK:
|
|
|
|
symbol: "kr"
|
|
|
|
student:
|
|
|
|
monthly: "50 kr"
|
|
|
|
annual: "500 kr"
|
|
|
|
collaborator:
|
|
|
|
monthly: "90 kr"
|
|
|
|
annual: "1080 kr"
|
|
|
|
professional:
|
|
|
|
monthly: "180 kr"
|
|
|
|
annual: "2160 kr"
|
|
|
|
|
|
|
|
AUD:
|
|
|
|
symbol: "$"
|
|
|
|
student:
|
|
|
|
monthly: "$10"
|
|
|
|
annual: "$100"
|
|
|
|
collaborator:
|
|
|
|
monthly: "$18"
|
|
|
|
annual: "$216"
|
|
|
|
professional:
|
|
|
|
monthly: "$35"
|
|
|
|
annual: "$420"
|
|
|
|
|
|
|
|
NZD:
|
|
|
|
symbol: "$"
|
|
|
|
student:
|
|
|
|
monthly: "$10"
|
|
|
|
annual: "$100"
|
|
|
|
collaborator:
|
|
|
|
monthly: "$18"
|
|
|
|
annual: "$216"
|
|
|
|
professional:
|
|
|
|
monthly: "$35"
|
|
|
|
annual: "$420"
|
|
|
|
|
|
|
|
CHF:
|
|
|
|
symbol: "Fr"
|
|
|
|
student:
|
2014-11-25 13:18:57 +00:00
|
|
|
monthly: "Fr 8"
|
|
|
|
annual: "Fr 80"
|
2014-11-19 21:34:01 +00:00
|
|
|
collaborator:
|
2014-11-25 13:18:57 +00:00
|
|
|
monthly: "Fr 15"
|
|
|
|
annual: "Fr 180"
|
2014-11-19 21:34:01 +00:00
|
|
|
professional:
|
2014-11-25 13:18:57 +00:00
|
|
|
monthly: "Fr 30"
|
|
|
|
annual: "Fr 360"
|
2014-11-19 21:34:01 +00:00
|
|
|
|
|
|
|
SGD:
|
|
|
|
symbol: "$"
|
|
|
|
student:
|
|
|
|
monthly: "$12"
|
|
|
|
annual: "$120"
|
|
|
|
collaborator:
|
2014-11-25 13:14:38 +00:00
|
|
|
monthly: "$20"
|
2014-11-19 21:34:01 +00:00
|
|
|
annual: "$240"
|
|
|
|
professional:
|
|
|
|
monthly: "$40"
|
|
|
|
annual: "$480"
|
2014-10-13 15:13:31 +00:00
|
|
|
}
|
2014-09-05 14:47:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-13 13:10:15 +00:00
|
|
|
App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
|
2014-10-15 15:21:45 +00:00
|
|
|
|
|
|
|
$scope.plans = MultiCurrencyPricing.plans
|
|
|
|
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
|
|
|
|
2014-10-21 12:48:46 +00:00
|
|
|
$scope.trial_len = 7
|
|
|
|
$scope.planQueryString = '_free_trial_7_days'
|
2014-09-05 14:47:08 +00:00
|
|
|
|
|
|
|
$scope.ui =
|
|
|
|
view: "monthly"
|
|
|
|
|
2014-10-15 15:21:45 +00:00
|
|
|
|
2014-09-04 18:03:04 +00:00
|
|
|
$scope.changeCurreny = (newCurrency)->
|
|
|
|
$scope.currencyCode = newCurrency
|
|
|
|
|
2014-07-21 10:33:10 +00:00
|
|
|
$scope.signUpNowClicked = (plan, annual)->
|
|
|
|
if $scope.ui.view == "annual"
|
|
|
|
plan = "#{plan}_annual"
|
2014-10-21 12:48:46 +00:00
|
|
|
|
2014-07-21 10:33:10 +00:00
|
|
|
event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
|
|
|
|
|
|
|
|
$scope.switchToMonthly = ->
|
|
|
|
$scope.ui.view = "monthly"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'monthly-prices'
|
|
|
|
|
|
|
|
$scope.switchToStudent = ->
|
|
|
|
$scope.ui.view = "student"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
|
|
|
|
|
|
|
|
$scope.switchToAnnual = ->
|
|
|
|
$scope.ui.view = "annual"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
|
2014-07-25 11:32:26 +00:00
|
|
|
|
|
|
|
$scope.openGroupPlanModal = () ->
|
|
|
|
$modal.open {
|
|
|
|
templateUrl: "groupPlanModalTemplate"
|
|
|
|
}
|