| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- define [
- "base"
- "libs/recurly-3.0.5"
- ], (App, recurly) ->
- App.factory "MultiCurrencyPricing", () ->
- currencyCode = window.recomendedCurrency
- return {
- currencyCode:currencyCode
- heron:
- USD:
- student:
- monthly: "$6"
- annual: "$60"
- collaborator:
- monthly: "$12"
- annual: "$144"
- EUR:
- student:
- monthly: "€5"
- annual: "€50"
- collaborator:
- monthly: "€11"
- annual: "€132"
- GBP:
- student:
- monthly: "£5"
- annual: "£50"
- collaborator:
- monthly: "£10"
- annual: "£120"
- SEK:
- student:
- monthly: "45 kr"
- annual: "450 kr"
- collaborator:
- monthly: "90 kr"
- annual: "1080 kr"
- CAD:
- student:
- monthly: "$7"
- annual: "$70"
- collaborator:
- monthly: "$14"
- annual: "$168"
- NOK:
- student:
- monthly: "45 kr"
- annual: "450 kr"
- collaborator:
- monthly: "90 kr"
- annual: "1080 kr"
- DKK:
- student:
- monthly: "40 kr"
- annual: "400 kr"
- collaborator:
- monthly: "70 kr"
- annual: "840 kr"
- AUD:
- student:
- monthly: "$8"
- annual: "$80"
- collaborator:
- monthly: "$15"
- annual: "$180"
- NZD:
- student:
- monthly: "$8"
- annual: "$80"
- collaborator:
- monthly: "$15"
- annual: "$180"
- CHF:
- student:
- monthly: "Fr 6"
- annual: "Fr 60"
- collaborator:
- monthly: "Fr 12"
- annual: "Fr 144"
- SGD:
- student:
- monthly: "$8"
- annual: "$80"
- collaborator:
- monthly: "$16"
- annual: "$192"
- ibis:
- USD:
- student:
- monthly: "$10"
- annual: "$100"
- collaborator:
- monthly: "$18"
- annual: "$216"
- EUR:
- student:
- monthly: "€9"
- annual: "€90"
- collaborator:
- monthly: "€17"
- annual: "€204"
- GBP:
- student:
- monthly: "£7"
- annual: "£70"
- collaborator:
- monthly: "£14"
- annual: "£168"
- SEK:
- student:
- monthly: "75 kr"
- annual: "750 kr"
- collaborator:
- monthly: "140 kr"
- annual: "1680 kr"
- CAD:
- student:
- monthly: "$12"
- annual: "$120"
- collaborator:
- monthly: "$22"
- annual: "$264"
- NOK:
- student:
- monthly: "75 kr"
- annual: "750 kr"
- collaborator:
- monthly: "140 kr"
- annual: "1680 kr"
- DKK:
- student:
- monthly: "68 kr"
- annual: "680 kr"
- collaborator:
- monthly: "110 kr"
- annual: "1320 kr"
- AUD:
- student:
- monthly: "$13"
- annual: "$130"
- collaborator:
- monthly: "$22"
- annual: "$264"
- NZD:
- student:
- monthly: "$14"
- annual: "$140"
- collaborator:
- monthly: "$22"
- annual: "$264"
- CHF:
- student:
- monthly: "Fr 10"
- annual: "Fr 100"
- collaborator:
- monthly: "Fr 18"
- annual: "Fr 216"
- SGD:
- student:
- monthly: "$14"
- annual: "$140"
- collaborator:
- monthly: "$25"
- annual: "$300"
- 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:
- monthly: "€14"
- annual: "€168"
- professional:
- monthly: "€28"
- annual: "€336"
- GBP:
- symbol: "£"
- student:
- monthly: "£6"
- annual: "£60"
- collaborator:
- monthly: "£12"
- annual: "£144"
- professional:
- monthly: "£24"
- annual: "£288"
- 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"
- 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:
- monthly: "Fr 8"
- annual: "Fr 80"
- collaborator:
- monthly: "Fr 15"
- annual: "Fr 180"
- professional:
- monthly: "Fr 30"
- annual: "Fr 360"
- SGD:
- symbol: "$"
- student:
- monthly: "$12"
- annual: "$120"
- collaborator:
- monthly: "$20"
- annual: "$240"
- professional:
- monthly: "$40"
- annual: "$480"
- }
- App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http, sixpack) ->
- $scope.showPlans = false
- $scope.plansVariant = 'default'
- $scope.shouldABTestPlans = window.shouldABTestPlans
- if $scope.shouldABTestPlans
- sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)->
- $scope.plansVariant = chosenVariation
- event_tracking.sendMB 'plans-page', {plans_variant: chosenVariation}
- if chosenVariation in ['heron', 'ibis']
- # overwrite student plans with alternative
- for currency, _v of $scope.plans
- $scope.plans[currency]['student'] = MultiCurrencyPricing[chosenVariation][currency]['student']
- $scope.plans[currency]['collaborator'] = MultiCurrencyPricing[chosenVariation][currency]['collaborator']
- $scope.showPlans = true
- else
- $scope.showPlans = true
- $scope.plans = MultiCurrencyPricing.plans
- $scope.currencyCode = MultiCurrencyPricing.currencyCode
- $scope.trial_len = 7
- $scope.planQueryString = '_free_trial_7_days'
- $scope.ui =
- view: "monthly"
- $scope.changeCurreny = (newCurrency)->
- $scope.currencyCode = newCurrency
- # because ternary logic in angular bindings is hard
- $scope.getCollaboratorPlanCode = () ->
- view = $scope.ui.view
- variant = $scope.plansVariant
- if view == "annual"
- if variant == "default"
- return "collaborator-annual"
- else
- return "collaborator-annual_#{variant}"
- else
- if variant == "default"
- return "collaborator#{$scope.planQueryString}"
- else
- return "collaborator_#{variant}"
- $scope.signUpNowClicked = (plan, annual)->
- event_tracking.sendMB 'plans-page-start-trial', {plan}
- if $scope.ui.view == "annual"
- plan = "#{plan}_annual"
- 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'
- $scope.openGroupPlanModal = () ->
- $modal.open {
- templateUrl: "groupPlanModalTemplate"
- }
|