diff --git a/services/web/app/views/subscriptions/new.jade b/services/web/app/views/subscriptions/new.jade index ab9b68e3a3..8bb9a106f6 100644 --- a/services/web/app/views/subscriptions/new.jade +++ b/services/web/app/views/subscriptions/new.jade @@ -1,4 +1,9 @@ extends ../layout +block scripts + script(type='text/javascript'). + window.recomendedCurrency = '#{currency}' + window.plan_code = '#{plan_code}' + block content - locals.supressDefaultJs = true @@ -8,11 +13,24 @@ block content .content.content-alt .container .row - .col-md-6.col-md-offset-3 + .col-md-6.col-md-offset-1 .card .page-header h1.text-centered #{translate("new_subscription")} #subscribeForm #{translate("loading_billing_form")}... + .col-md-5(ng-controller="NewSubscriptionController") + span.dropdown.col-md-1.changePlanButton() + a.btn.btn-primary.dropdown-toggle( + href="#", + data-toggle="dropdown" + ) + | {{currencyCode}} ({{plans[currencyCode]['symbol']}}) + ul.dropdown-menu(role="menu") + li(ng-repeat="(currency, value) in plans", dropdown-toggle) + a( + ng-click="changeCurrency(currency)", + ) {{currency}} ({{value['symbol']}}) + script(type="text/javascript"). ga('send', 'event', 'pageview', 'payment_form', "#{plan_code}") diff --git a/services/web/public/coffee/main.coffee b/services/web/public/coffee/main.coffee index 9998979a63..908e4be549 100644 --- a/services/web/public/coffee/main.coffee +++ b/services/web/public/coffee/main.coffee @@ -11,6 +11,7 @@ define [ "main/system-messages" "main/translations" "main/subscription-dashboard" + "main/new-subscription" "main/annual-upgrade" "analytics/AbTestingManager" "directives/asyncForm" diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee new file mode 100644 index 0000000000..f03b7e70c6 --- /dev/null +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -0,0 +1,12 @@ +define [ + "base" +], (App)-> + + App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing)-> + + + $scope.currencyCode = MultiCurrencyPricing.currencyCode + $scope.plans = MultiCurrencyPricing.plans + + $scope.changeCurrency = (newCurrency)-> + window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}" \ No newline at end of file