From bcb6f97385fa107566b71324fa593362c8ca5915 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 16 Sep 2016 14:46:25 -0300 Subject: [PATCH 1/2] Fix Glidera routes --- public/views/buyGlidera.html | 8 +-- public/views/buyandsell.html | 5 +- public/views/glidera.html | 19 +++--- public/views/modals/glidera-confirmation.html | 14 ----- public/views/preferencesGlidera.html | 2 +- public/views/sellGlidera.html | 8 +-- public/views/tab-home.html | 63 ++++++++++++------- src/js/controllers/glideraUri.js | 2 +- .../controllers/modals/glideraConfirmation.js | 18 ------ src/js/controllers/preferencesGlidera.js | 2 +- src/js/routes.js | 56 +++++++++-------- src/js/services/glideraService.js | 2 +- 12 files changed, 95 insertions(+), 104 deletions(-) delete mode 100644 public/views/modals/glidera-confirmation.html delete mode 100644 src/js/controllers/modals/glideraConfirmation.js diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index bdbdd6cf0..4e20c3c37 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -1,7 +1,7 @@ - @@ -65,10 +65,10 @@ class="postfix" on-tap="showAlternative = false; fiat = null; buy.buyPrice = null">USD - - + +
Buy {{buy.buyPrice.subtotal|currency:'':2}} {{buy.buyPrice.currency}} in Bitcoin @@ -120,7 +120,7 @@ A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business days.

- +
diff --git a/public/views/buyandsell.html b/public/views/buyandsell.html index 101927d52..3a06db502 100644 --- a/public/views/buyandsell.html +++ b/public/views/buyandsell.html @@ -9,8 +9,9 @@ - - + + + diff --git a/public/views/glidera.html b/public/views/glidera.html index 4933fa584..d2a32d31d 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -1,10 +1,9 @@ - - - + + + + Glidera @@ -84,7 +83,7 @@
- + {{personalInfo.firstName}} {{personalInfo.lastName}} @@ -112,15 +111,15 @@ ng-show="status && status.userCanTransact"> - buy bitcoin + href ui-sref="tabs.buyandsell.glidera.buy"> + buy bitcoin Buy Bitcoin - buy bitcoin + href ui-sref="tabs.buyandsell.glidera.sell"> + buy bitcoin Sell Bitcoin diff --git a/public/views/modals/glidera-confirmation.html b/public/views/modals/glidera-confirmation.html deleted file mode 100644 index 1a8f5622b..000000000 --- a/public/views/modals/glidera-confirmation.html +++ /dev/null @@ -1,14 +0,0 @@ - - -
-

Are you sure you would like to log out of your Glidera account?

-

You will need to log back in to buy or sell bitcoin in Copay.

- - -
-
-
diff --git a/public/views/preferencesGlidera.html b/public/views/preferencesGlidera.html index 6adc813d2..c32920356 100644 --- a/public/views/preferencesGlidera.html +++ b/public/views/preferencesGlidera.html @@ -1,7 +1,7 @@ - diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index 8d18628b5..657338b22 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -1,7 +1,7 @@ - @@ -64,10 +64,10 @@ class="postfix" on-tap="showAlternative = false; fiat = null; sell.sellPrice = null">USD - -
+ +
Sell {{sell.sellPrice.subtotal|currency:'':2}} {{sell.sellPrice.currency}} in Bitcoin @@ -121,7 +121,7 @@ A transfer has been initiated to your bank account and should arrive in 4-6 business days.

- +
diff --git a/public/views/tab-home.html b/public/views/tab-home.html index 2a4b0c8bd..935b34bb7 100644 --- a/public/views/tab-home.html +++ b/public/views/tab-home.html @@ -44,10 +44,13 @@ -

{{wallet.name || wallet.id}}

- - {{wallet.m}}-of-{{wallet.n}} - +

+ {{wallet.name || wallet.id}} + + {{wallet.m}}-of-{{wallet.n}} + +

+ Incomplete @@ -59,22 +62,26 @@

- - + + +
+

BitPay Card

-
- - -

Gift Cards

+

Add funds to get started

+
-
- Buy & Sell Bitcoin +
+ Buy & Sell Bitcoin +
- + +
+ +
+ ng-show="!externalServices.AmazonGiftCards || !externalServices.BitpayCard || !externalServices.BuyAndSell || !wallets[0]">
Next steps
- +
Create a bitcoin wallet
- - -
-
- Buy Bitcoin - -
@@ -108,11 +118,18 @@ Add BitPay Card
+ + +
+
+ Buy or Sell Bitcoin + +
- Add Amazon Gift Card + Buy Amazon.com Gift Card
diff --git a/src/js/controllers/glideraUri.js b/src/js/controllers/glideraUri.js index 7d10d9562..aef209427 100644 --- a/src/js/controllers/glideraUri.js +++ b/src/js/controllers/glideraUri.js @@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('glideraUriController', } else if (data && data.access_token) { storageService.setGlideraToken($scope.network, data.access_token, function() { $timeout(function() { - $state.go('glidera.main'); + $state.go('tabs.buyandsell.glidera'); $scope.$apply(); }, 500); }); diff --git a/src/js/controllers/modals/glideraConfirmation.js b/src/js/controllers/modals/glideraConfirmation.js deleted file mode 100644 index 8a1b846ef..000000000 --- a/src/js/controllers/modals/glideraConfirmation.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('glideraConfirmationController', function($scope, $timeout, $state, glideraService) { - - $scope.ok = function() { - glideraService.removeToken(function() { - $timeout(function() { - $state.go('glidera.main'); - }, 100); - }); - $scope.cancel(); - }; - - $scope.cancel = function() { - $scope.glideraConfirmationModal.hide(); - }; - -}); diff --git a/src/js/controllers/preferencesGlidera.js b/src/js/controllers/preferencesGlidera.js index 16749e66e..d9352d832 100644 --- a/src/js/controllers/preferencesGlidera.js +++ b/src/js/controllers/preferencesGlidera.js @@ -68,7 +68,7 @@ angular.module('copayApp.controllers').controller('preferencesGlideraController' if (res) { glideraService.removeToken(function() { $timeout(function() { - $state.go('glidera.main'); + $state.go('tabs.buyandsell.glidera'); }, 100); }); } diff --git a/src/js/routes.js b/src/js/routes.js index 0794cd07c..c520854c3 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -109,11 +109,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr templateUrl: 'views/starting.html' }) - .state('buyandsell', { - url: '/buyandsell', - templateUrl: 'views/buyandsell.html' - }) - /* * * URI @@ -636,46 +631,57 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr }, }) - /* - * - * Glidera - * - * - */ - .state('glidera', { - url: '/glidera', - abstract: true, - template: '' - }) - .state('glidera.main', { - url: '/main', + /* + * + * Buy or Sell Bitcoin + * + */ + + .state('tabs.buyandsell', { + url: '/buyandsell', views: { - 'glidera': { + 'tab-home': { + templateUrl: 'views/buyandsell.html' + } + } + }) + + /* + * + * Glidera + * + * + */ + + .state('tabs.buyandsell.glidera', { + url: '/glidera', + views: { + 'tab-home@tabs': { templateUrl: 'views/glidera.html' } } }) - .state('glidera.buy', { + .state('tabs.buyandsell.glidera.buy', { url: '/buy', views: { - 'glidera': { + 'tab-home@tabs': { templateUrl: 'views/buyGlidera.html' } } }) - .state('glidera.sell', { + .state('tabs.buyandsell.glidera.sell', { url: '/sell', views: { - 'glidera': { + 'tab-home@tabs': { templateUrl: 'views/sellGlidera.html' } } }) - .state('glidera.preferences', { + .state('tabs.buyandsell.glidera.preferences', { url: '/preferences', views: { - 'glidera': { + 'tab-home@tabs': { templateUrl: 'views/preferencesGlidera.html' } } diff --git a/src/js/services/glideraService.js b/src/js/services/glideraService.js index 3f9dfe440..5d0f687b3 100644 --- a/src/js/services/glideraService.js +++ b/src/js/services/glideraService.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').factory('glideraService', function($http, $log, $window, platformInfo, storageService, configService, $rootScope) { +angular.module('copayApp.services').factory('glideraService', function($http, $log, $window, platformInfo, storageService) { var root = {}; var credentials = {}; var isCordova = platformInfo.isCordova; From eead8ee9a735ef76680c44856c85e613333d60c6 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 16 Sep 2016 14:54:39 -0300 Subject: [PATCH 2/2] ion-nav-back-button generic --- public/views/buyGlidera.html | 8 +++----- public/views/glidera.html | 1 - public/views/modals/glidera-tx-details.html | 6 +++--- public/views/preferencesGlidera.html | 8 +++----- public/views/sellGlidera.html | 8 +++----- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/public/views/buyGlidera.html b/public/views/buyGlidera.html index 4e20c3c37..f315aa11f 100644 --- a/public/views/buyGlidera.html +++ b/public/views/buyGlidera.html @@ -1,10 +1,8 @@ - - - + + + Buy diff --git a/public/views/glidera.html b/public/views/glidera.html index d2a32d31d..c68df1e87 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -3,7 +3,6 @@ - Glidera diff --git a/public/views/modals/glidera-tx-details.html b/public/views/modals/glidera-tx-details.html index 1e2dd1261..eead98fd2 100644 --- a/public/views/modals/glidera-tx-details.html +++ b/public/views/modals/glidera-tx-details.html @@ -1,10 +1,10 @@ - - -

Details

+

Details

diff --git a/public/views/preferencesGlidera.html b/public/views/preferencesGlidera.html index c32920356..2f04020a1 100644 --- a/public/views/preferencesGlidera.html +++ b/public/views/preferencesGlidera.html @@ -1,10 +1,8 @@ - - - + + + Preferences diff --git a/public/views/sellGlidera.html b/public/views/sellGlidera.html index 657338b22..cb2bc0f77 100644 --- a/public/views/sellGlidera.html +++ b/public/views/sellGlidera.html @@ -1,10 +1,8 @@ - - - + + + Sell