From 734e9e9472a456a8703eb2a47c3a650ec48744ef Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 14 Jun 2016 11:44:44 -0300 Subject: [PATCH] Simplify UI --- public/views/amazon.html | 18 ++-- public/views/buyAmazon.html | 39 ++------ public/views/modals/amazon-card-details.html | 95 ++++---------------- src/js/controllers/buyAmazon.js | 43 ++++----- src/sass/main.scss | 4 + 5 files changed, 54 insertions(+), 145 deletions(-) diff --git a/public/views/amazon.html b/public/views/amazon.html index 26545e338..67773e75d 100644 --- a/public/views/amazon.html +++ b/public/views/amazon.html @@ -37,18 +37,7 @@
Only redeemable on www.amazon.com (USA website)
-
-
- Amazon.com Gift Cards* never expire and can be redeemed towards millions of items at - www.amazon.com, - www.myhabit.com, and - certain of its affiliated websites. Amazon.com’s huge - selection includes products in Books, Electronics, Music, MP3 Downloads, DVD, Clothing, Video Games, - Software, Sports & Outdoors, Toys, Baby, Computers & Office, Home & Garden, Jewelry, - Beauty, Cell Phones & Accessories, Home Improvement, Office Products, Camera & Photo, - Pet Supplies, and more. Amazon.com is the place to find and discover almost anything you - want to buy online at a great price. -
+
@@ -58,6 +47,11 @@
+ +
+ Amazon.com Gift Cards never expire and can be redeemed towards millions of items at + www.amazon.com +
diff --git a/public/views/buyAmazon.html b/public/views/buyAmazon.html index d1a707108..3321f8c93 100644 --- a/public/views/buyAmazon.html +++ b/public/views/buyAmazon.html @@ -7,7 +7,7 @@
-
+
@@ -27,13 +27,14 @@
-
- Amazon.com Gift Card -
+
+ Amazon.com Gift Card +
Use your Amazon.com Gift Card* to shop from a huge selection of books, electronics, music, movies, software, apparel, toys, and more.
@@ -73,7 +74,7 @@
-
+

Gift card could not be created

@@ -103,7 +104,7 @@
- Amazon.com Gift Cards + Amazon.com Gift Cards
Gift Card Amount: @@ -120,32 +121,6 @@
- - - - -
-
To redeem your gift card, follow these steps:
-
    -
  1. Visit www.amazon.com/gc.
  2. -
  3. Click Apply to Account and enter the claim code when prompted.
  4. -
  5. Gift card funds will be applied automatically to eligible orders during the checkout process.
  6. -
  7. You must pay for any remaining balance on your order with another payment method.
  8. -
-

Your gift card claim code may also be entered when prompted during checkout. - To redeem your gift card using the Amazon.com 1-Click® service, first add the gift card - funds to Your Account.

-

If you have questions about redeeming your gift card, please visit - www.amazon.com/gc-redeem. - If you have questions regarding the BitPay offer, please contact BitPay.

-
-
diff --git a/public/views/modals/amazon-card-details.html b/public/views/modals/amazon-card-details.html index 0dba3f34c..f3ba06b38 100644 --- a/public/views/modals/amazon-card-details.html +++ b/public/views/modals/amazon-card-details.html @@ -16,7 +16,7 @@
-
-
To redeem your gift card, follow these steps:
-
    -
  1. Visit www.amazon.com/gc.
  2. -
  3. Click Apply to Account and enter the claim code when prompted.
  4. -
  5. Gift card funds will be applied automatically to eligible orders during the checkout process.
  6. -
  7. You must pay for any remaining balance on your order with another payment method.
  8. -
-

Your gift card claim code may also be entered when prompted during checkout. - To redeem your gift card using the Amazon.com 1-Click® service, first add the gift card - funds to Your Account.

-

If you have questions about redeeming your gift card, please visit - www.amazon.com/gc-redeem. - If you have questions regarding the BitPay offer, please contact BitPay.

-
- -
    -

    Details

    -
  • - Card status - Fulfilled - Refunded to purchaser - Expired -
  • -
  • - Created at - {{card.date * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} -
  • -
  • - Creation status - Success - Resend is required - Error - Refunded -
  • -
  • - - BitPay Invoice - {{card.bitpayInvoiceId}} -
  • -
- -
-
-

- This action will remove the gift card -

- -
-
- -
-
-

- This action will cancel the gift card -

- -
-
- -
+
*Amazon.com Gift Cards ("GCs") sold by BitPay, Inc., an authorized and independent reseller of Amazon.com Gift Cards. Except as required by law, GCs cannot be transferred for value or redeemed for cash. GCs may be used only for purchases of eligible goods at Amazon.com or certain of its affiliated websites. Purchases are @@ -149,6 +80,16 @@ Amazon.com, Inc. or its affiliates. No expiration date or service fees.
+
    +
  • + Cancel gift card +
  • +
  • + Remove gift card +
  • +
+
diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index b9f374b25..be381a2d0 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -5,10 +5,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController', var self = this; var client; - var limitsAllowed = { - min: 0.01, - max: 2000 - }; var handleEncryptedWallet = function(client, cb) { if (!walletService.isEncrypted(client)) return cb(); @@ -34,14 +30,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController', } }; - this.checkLimits = function() { -console.log('[buyAmazon.js:37]'); //TODO - if ($scope.fiat && $scope.fiat >= limitsAllowed.min && $scope.fiat <= limitsAllowed.max) - return true; - else - return false; - }; - $scope.openWalletsModal = function(wallets) { self.error = null; @@ -82,14 +70,16 @@ console.log('[buyAmazon.js:37]'); //TODO var walletSettings = configWallet.settings; - ongoingProcess.set('Creating invoice...', true); + ongoingProcess.set('Processing Transaction...', true); $timeout(function() { amazonService.createBitPayInvoice(dataSrc, function(err, data) { - ongoingProcess.set('Creating invoice...', false); if (err) { + ongoingProcess.set('Processing Transaction...', false); self.error = bwsError.msg(err); - $scope.$apply(); + $timeout(function() { + $scope.$digest(); + }); return; } @@ -115,22 +105,24 @@ console.log('[buyAmazon.js:37]'); //TODO feeLevel: walletSettings.feeLevel || 'normal' }; - ongoingProcess.set('Creating transaction...', true); walletService.createTx(client, txp, function(err, createdTxp) { - ongoingProcess.set('Creating transaction...', false); + ongoingProcess.set('Processing Transaction...', false); if (err) { self.error = bwsError.msg(err); - $scope.$apply(); + $timeout(function() { + $scope.$digest(); + }); return; } $scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) { if (accept) { - ongoingProcess.set('Sending bitcoin...', true); self.confirmTx(createdTxp, function(err, tx) { - ongoingProcess.set('Sending bitcoin...', false); if (err) { + ongoingProcess.set('Processing Transaction...', false); self.error = bwsError.msg(err); - $scope.$apply(); + $timeout(function() { + $scope.$digest(); + }); return; } var gift = { @@ -139,13 +131,15 @@ console.log('[buyAmazon.js:37]'); //TODO bitpayInvoiceId: data.data.id, bitpayInvoiceUrl: data.data.url }; - ongoingProcess.set('Creating gift card...', true); + ongoingProcess.set('Processing Transaction...', true); amazonService.createGiftCard(gift, function(err, giftCard) { - ongoingProcess.set('Creating gift card...', false); + ongoingProcess.set('Processing Transaction...', false); if (err) { self.error = bwsError.msg(err); self.errorInfo = gift; - $scope.$apply(); + $timeout(function() { + $scope.$digest(); + }); return; } amazonService.setAmountByDay(dataSrc.price); @@ -176,6 +170,7 @@ console.log('[buyAmazon.js:37]'); //TODO return bwsError.cb(err, null, cb); } + ongoingProcess.set('Processing Transaction...', true); walletService.publishTx(client, txp, function(err, publishedTxp) { if (err) { $log.debug(err); diff --git a/src/sass/main.scss b/src/sass/main.scss index 73be3a3fb..bc6b3656b 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -785,6 +785,10 @@ ul.manage li { margin: 20px 0; } +.m30v { + margin: 30px 0; +} + .m30a { margin: 30px auto; }