diff --git a/app/partials/buy-modal.jade b/app/partials/coinify-modal.jade similarity index 92% rename from app/partials/buy-modal.jade rename to app/partials/coinify-modal.jade index 8daa4369c3..219533323c 100644 --- a/app/partials/buy-modal.jade +++ b/app/partials/coinify-modal.jade @@ -32,16 +32,16 @@ .modal-body.fade.flex-center.flex-justify(class="{{isxStep}}" ng-class="{'summary': onStep('summary'), 'isx': onStep('isx')}") .alert-in-app alerts(context="alerts") - div.width-80(ng-show="onStep('select-country')" ng-controller="BuySelectCountryCtrl") - include ./buy/select-country - div.width-80(ng-show="onStep('email')" ng-controller="BuyEmailCtrl") - include ./buy/email - div.width-80(ng-show="onStep('accept-terms')" ng-controller="BuyAcceptTermsCtrl") - include ./buy/accept-terms - div.width-80(ng-show="onStep('select-payment-method')" ng-controller="BuySelectPaymentMethodCtrl") - include ./buy/select-payment-method - div.width-80(ng-show="onStep('summary')" ng-controller="BuySummaryCtrl") - include ./buy/summary + div.width-80(ng-show="onStep('select-country')" ng-controller="CoinifyCountryController") + include ./coinify/country + div.width-80(ng-show="onStep('email')" ng-controller="CoinifyEmailController") + include ./coinify/email + div.width-80(ng-show="onStep('accept-terms')" ng-controller="CoinifySignupController") + include ./coinify/signup + div.width-80(ng-show="onStep('select-payment-method')" ng-controller="CoinifyMediumController") + include ./coinify/medium + div.width-80(ng-show="onStep('summary')" ng-controller="CoinifySummaryController") + include ./coinify/summary div.iframe(ng-if="onStep('isx')") isignthis(transaction-id='trade.iSignThisID' on-load="loadPayment()" on-complete="formatTrade" payment-info="paymentInfo" on-resize="onResize(step)") div.width-80(ng-if="onStep('trade-in-review', 'trade-formatted')") diff --git a/app/partials/buy/select-country.jade b/app/partials/coinify/country.jade similarity index 100% rename from app/partials/buy/select-country.jade rename to app/partials/coinify/country.jade diff --git a/app/partials/buy/email.jade b/app/partials/coinify/email.jade similarity index 100% rename from app/partials/buy/email.jade rename to app/partials/coinify/email.jade diff --git a/app/partials/buy/select-payment-method.jade b/app/partials/coinify/medium.jade similarity index 100% rename from app/partials/buy/select-payment-method.jade rename to app/partials/coinify/medium.jade diff --git a/app/partials/buy/accept-terms.jade b/app/partials/coinify/signup.jade similarity index 100% rename from app/partials/buy/accept-terms.jade rename to app/partials/coinify/signup.jade diff --git a/app/partials/buy/summary.jade b/app/partials/coinify/summary.jade similarity index 100% rename from app/partials/buy/summary.jade rename to app/partials/coinify/summary.jade diff --git a/assets/js/controllers/buysell/buySell.controller.js b/assets/js/controllers/buySell.controller.js similarity index 100% rename from assets/js/controllers/buysell/buySell.controller.js rename to assets/js/controllers/buySell.controller.js diff --git a/assets/js/controllers/buysell/buy.controller.js b/assets/js/controllers/coinify/coinify.controller.js similarity index 97% rename from assets/js/controllers/buysell/buy.controller.js rename to assets/js/controllers/coinify/coinify.controller.js index a42c50e70e..f4e6d73b60 100644 --- a/assets/js/controllers/buysell/buy.controller.js +++ b/assets/js/controllers/coinify/coinify.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuyCtrl', BuyCtrl); + .controller('CoinifyController', CoinifyController); -function BuyCtrl ($scope, $filter, $q, MyWallet, Wallet, MyWalletHelpers, Alerts, currency, $uibModalInstance, trade, buyOptions, $timeout, $interval, formatTrade, buySell, $rootScope) { +function CoinifyController ($scope, $filter, $q, MyWallet, Wallet, MyWalletHelpers, Alerts, currency, $uibModalInstance, trade, buyOptions, $timeout, $interval, formatTrade, buySell, $rootScope) { $scope.settings = Wallet.settings; $scope.btcCurrency = $scope.settings.btcCurrency; $scope.currencies = currency.coinifyCurrencies; diff --git a/assets/js/controllers/buysell/buySelectCountry.controller.js b/assets/js/controllers/coinify/coinifyCountry.controller.js similarity index 93% rename from assets/js/controllers/buysell/buySelectCountry.controller.js rename to assets/js/controllers/coinify/coinifyCountry.controller.js index 12dc7055d3..8f7e3e11f8 100644 --- a/assets/js/controllers/buysell/buySelectCountry.controller.js +++ b/assets/js/controllers/coinify/coinifyCountry.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuySelectCountryCtrl', BuySelectCountryCtrl); + .controller('CoinifyCountryController', CoinifyCountryController); -function BuySelectCountryCtrl ($scope, country, MyWallet, buySell) { +function CoinifyCountryController ($scope, country, MyWallet, buySell) { $scope.countries = country; let blacklist = [{'Name': 'Algeria', 'Code': 'DZ'}, diff --git a/assets/js/controllers/buysell/buyEmail.controller.js b/assets/js/controllers/coinify/coinifyEmail.controller.js similarity index 81% rename from assets/js/controllers/buysell/buyEmail.controller.js rename to assets/js/controllers/coinify/coinifyEmail.controller.js index cce5825cfd..bbc5506dad 100644 --- a/assets/js/controllers/buysell/buyEmail.controller.js +++ b/assets/js/controllers/coinify/coinifyEmail.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuyEmailCtrl', BuyEmailCtrl); + .controller('CoinifyEmailController', CoinifyEmailController); -function BuyEmailCtrl ($scope, Alerts, Wallet, $q) { +function CoinifyEmailController ($scope, Alerts, Wallet, $q) { $scope.toggleEmail = () => $scope.editEmail = !$scope.editEmail; $scope.changeEmail = (email, successCallback, errorCallback) => { diff --git a/assets/js/controllers/buysell/buySelectPaymentMethod.controller.js b/assets/js/controllers/coinify/coinifyMedium.controller.js similarity index 82% rename from assets/js/controllers/buysell/buySelectPaymentMethod.controller.js rename to assets/js/controllers/coinify/coinifyMedium.controller.js index 49f2875de1..0d1f4e71c8 100644 --- a/assets/js/controllers/buysell/buySelectPaymentMethod.controller.js +++ b/assets/js/controllers/coinify/coinifyMedium.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuySelectPaymentMethodCtrl', BuySelectPaymentMethodCtrl); + .controller('CoinifyMediumController', CoinifyMediumController); -function BuySelectPaymentMethodCtrl ($scope, Alerts, buySell) { +function CoinifyMediumController ($scope, Alerts, buySell) { $scope.$parent.method = $scope.trade ? $scope.trade.medium : undefined; $scope.$parent.methods = {}; diff --git a/assets/js/controllers/buysell/buyAcceptTerms.controller.js b/assets/js/controllers/coinify/coinifySignup.controller.js similarity index 80% rename from assets/js/controllers/buysell/buyAcceptTerms.controller.js rename to assets/js/controllers/coinify/coinifySignup.controller.js index 70da25c4eb..44636542e3 100644 --- a/assets/js/controllers/buysell/buyAcceptTerms.controller.js +++ b/assets/js/controllers/coinify/coinifySignup.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuyAcceptTermsCtrl', BuyAcceptTermsCtrl); + .controller('CoinifySignupController', CoinifySignupController); -function BuyAcceptTermsCtrl ($scope, Alerts, buySell) { +function CoinifySignupController ($scope, Alerts, buySell) { $scope.$parent.signup = () => { $scope.status.waiting = true; Alerts.clear($scope.alerts); diff --git a/assets/js/controllers/buysell/buySummary.controller.js b/assets/js/controllers/coinify/coinifySummary.controller.js similarity index 95% rename from assets/js/controllers/buysell/buySummary.controller.js rename to assets/js/controllers/coinify/coinifySummary.controller.js index 40b5eb6f19..f12d6aea21 100644 --- a/assets/js/controllers/buysell/buySummary.controller.js +++ b/assets/js/controllers/coinify/coinifySummary.controller.js @@ -1,8 +1,8 @@ angular .module('walletApp') - .controller('BuySummaryCtrl', BuySummaryCtrl); + .controller('CoinifySummaryController', CoinifySummaryController); -function BuySummaryCtrl ($scope, $q, $timeout, Wallet, buySell, currency, Alerts) { +function CoinifySummaryController ($scope, $q, $timeout, Wallet, buySell, currency, Alerts) { $scope.$parent.limits = {}; $scope.exchange = buySell.getExchange(); $scope.toggleEditAmount = () => $scope.$parent.editAmount = !$scope.$parent.editAmount; diff --git a/assets/js/services/buySell.service.js b/assets/js/services/buySell.service.js index 104ca169bc..8e86a949bb 100644 --- a/assets/js/services/buySell.service.js +++ b/assets/js/services/buySell.service.js @@ -208,9 +208,9 @@ function buySell ($rootScope, $timeout, $q, $state, $uibModal, $uibModalStack, W function openBuyView (trade = null, options = {}) { return $uibModal.open({ - templateUrl: 'partials/buy-modal.jade', + templateUrl: 'partials/coinify-modal.jade', windowClass: 'bc-modal auto buy', - controller: 'BuyCtrl', + controller: 'CoinifyController', backdrop: 'static', keyboard: false, resolve: { diff --git a/karma.conf.js b/karma.conf.js index dbdd1e4e91..846210555c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -40,7 +40,7 @@ module.exports = function (config) { 'assets/js/walletLazyLoad.js', 'assets/js/core/*.js', 'tests/filters/*.coffee', - 'tests/controllers/*.coffee', + 'tests/controllers/**/*.coffee', 'tests/components/*.coffee', 'tests/services/**/*.coffee', 'tests/directives/*.coffee', diff --git a/tests/controllers/buy_select_country_ctrl_spec.coffee b/tests/controllers/coinify/coinify_country_ctrl_spec.coffee similarity index 94% rename from tests/controllers/buy_select_country_ctrl_spec.coffee rename to tests/controllers/coinify/coinify_country_ctrl_spec.coffee index a228bef07c..5c800be07b 100644 --- a/tests/controllers/buy_select_country_ctrl_spec.coffee +++ b/tests/controllers/coinify/coinify_country_ctrl_spec.coffee @@ -1,4 +1,4 @@ -describe "BuySelectCountryCtrl", -> +describe "CoinifyCountryController", -> scope = undefined country = undefined MyWallet = undefined @@ -29,7 +29,7 @@ describe "BuySelectCountryCtrl", -> getControllerScope = (params = {}) -> scope = $rootScope.$new() - $controller "BuySelectCountryCtrl", + $controller "CoinifyCountryController", $scope: scope, scope diff --git a/tests/controllers/buy_ctrl_spec.coffee b/tests/controllers/coinify/coinify_ctrl_spec.coffee similarity index 98% rename from tests/controllers/buy_ctrl_spec.coffee rename to tests/controllers/coinify/coinify_ctrl_spec.coffee index 5605ba8230..ff1d9e9f59 100644 --- a/tests/controllers/buy_ctrl_spec.coffee +++ b/tests/controllers/coinify/coinify_ctrl_spec.coffee @@ -1,4 +1,4 @@ -describe "BuyCtrl", -> +describe "CoinifyController", -> scope = undefined Wallet = undefined Alerts = undefined @@ -45,7 +45,7 @@ describe "BuyCtrl", -> getControllerScope = (params = {}) -> scope = $rootScope.$new() - $controller "BuyCtrl", + $controller "CoinifyController", $scope: scope, $uibModalInstance: params.modalInstance ? { close: (->) dismiss: (->) } trade: params.trade ? false diff --git a/tests/controllers/buy_summary_ctrl_spec.coffee b/tests/controllers/coinify/coinify_summary_ctrl_spec.coffee similarity index 97% rename from tests/controllers/buy_summary_ctrl_spec.coffee rename to tests/controllers/coinify/coinify_summary_ctrl_spec.coffee index 42b21f60e1..67dbf717da 100644 --- a/tests/controllers/buy_summary_ctrl_spec.coffee +++ b/tests/controllers/coinify/coinify_summary_ctrl_spec.coffee @@ -1,4 +1,4 @@ -describe "BuySummaryCtrl", -> +describe "CoinifySummaryController", -> scope = undefined Wallet = undefined currency = undefined @@ -58,7 +58,7 @@ describe "BuySummaryCtrl", -> getControllerScope = (params = {}) -> scope = $rootScope.$new() scope.transaction = {fiat: 0, btc: 0, fee: 0, total: 0, currency: {symbol: 'E', code: 'EUR'}}; - $controller "BuySummaryCtrl", + $controller "CoinifySummaryController", $scope: scope exchange: {} scope