Simplify UI

This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-14 11:44:44 -03:00
commit 734e9e9472
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 54 additions and 145 deletions

View file

@ -37,18 +37,7 @@
<div class="size-10 m5t text-gray"><b>Only</b> redeemable on www.amazon.com (USA website)</div> <div class="size-10 m5t text-gray"><b>Only</b> redeemable on www.amazon.com (USA website)</div>
</div> </div>
<div ng-if="!amazon.giftCards" class="m20t text-center size-12"> <div ng-if="!amazon.giftCards" class="m20t text-center size-12">
<div class="text-left p10h">
Amazon.com Gift Cards* never expire and can be redeemed towards millions of items at
<a ng-click="$root.openExternalLink('https://www.amazon.com')">www.amazon.com</a>,
<a ng-click="$root.openExternalLink('https://www.myhabit.com')">www.myhabit.com</a>, and
certain of its affiliated websites. Amazon.com&rsquo;s huge
selection includes products in Books, Electronics, Music, MP3 Downloads, DVD, Clothing, Video Games,
Software, Sports &amp; Outdoors, Toys, Baby, Computers &amp; Office, Home &amp; Garden, Jewelry,
Beauty, Cell Phones &amp; Accessories, Home Improvement, Office Products, Camera &amp; 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.
</div>
<div class="row"> <div class="row">
<div class="columns"> <div class="columns">
@ -58,6 +47,11 @@
</button> </button>
</div> </div>
</div> </div>
<div class="text-left p10h m30v">
Amazon.com Gift Cards never expire and can be redeemed towards millions of items at
<a ng-click="$root.openExternalLink('https://www.amazon.com')">www.amazon.com</a>
</div>
</div> </div>
<div ng-if="amazon.giftCards"> <div ng-if="amazon.giftCards">

View file

@ -7,7 +7,7 @@
<div class="content amazon" ng-controller="buyAmazonController as buy"> <div class="content amazon" ng-controller="buyAmazonController as buy">
<div class="row m20t" ng-show="!buy.giftCard" ng-init="buy.init()"> <div class="row m10t" ng-show="!buy.giftCard" ng-init="buy.init()">
<div class="columns"> <div class="columns">
<div class="box-notification m20b" ng-show="buy.error" ng-click="buy.error = null"> <div class="box-notification m20b" ng-show="buy.error" ng-click="buy.error = null">
@ -27,13 +27,14 @@
</div> </div>
</div> </div>
<div class="text-center m20b"> <div class="text-center">
<img src="img/a_generic.jpg" alt="Amazon.com Gift Card" width="200"> <img src="img/a_generic.jpg" alt="Amazon.com Gift Card" width="180">
<div class="text-left size-12 m10t"> <div class="text-left size-10 m10t">
Use your Amazon.com Gift Card* to shop from a huge selection of books, electronics, music, movies, software, apparel, toys, and more. Use your Amazon.com Gift Card* to shop from a huge selection of books, electronics, music, movies, software, apparel, toys, and more.
</div> </div>
</div> </div>
<form <form
class="m30v"
name="buyAmazonForm" name="buyAmazonForm"
ng-submit="buy.createTx()" ng-submit="buy.createTx()"
novalidate> novalidate>
@ -73,7 +74,7 @@
</div> </div>
</div> </div>
<div class="m20t" ng-show="buy.giftCard"> <div class="m10t" ng-show="buy.giftCard">
<div class="m10h" ng-show="buy.giftCard.status != 'SUCCESS'"> <div class="m10h" ng-show="buy.giftCard.status != 'SUCCESS'">
<h1 class="text-center">Gift card could not be created</h1> <h1 class="text-center">Gift card could not be created</h1>
<div class="box-notification m20b"> <div class="box-notification m20b">
@ -103,7 +104,7 @@
</div> </div>
<div class="oh m20t size-12 text-center"> <div class="oh m20t size-12 text-center">
<img class="m10h" src="img/a_generic.jpg" alt="Amazon.com Gift Cards" width="230"> <img class="m10h" src="img/a_generic.jpg" alt="Amazon.com Gift Cards" width="200">
<div class="m10t size-14"> <div class="m10t size-14">
Gift Card Amount: Gift Card Amount:
<span class="text-bold"> <span class="text-bold">
@ -120,32 +121,6 @@
</button> </button>
</div> </div>
</div> </div>
<div class="size-12 m10t text-center">
| <a
ng-click="$root.openExternalLink('https://www.amazon.com/gp/css/gc/payment/view-gc-balance?claimCode=' + buy.giftCard.gcClaimCode, '_system')">
Apply to Account
</a> |
<a ng-click="$root.openExternalLink('http://www.amazon.com/gc-redeem')">How to Use</a> |
</div>
<div class="m20t size-12 white line-t p10">
<div class="text-bold m10b">To redeem your gift card, follow these steps:</div>
<ol class="size-12">
<li>Visit <a ng-click="$root.openExternalLink('https://www.amazon.com/gc')">www.amazon.com/gc</a>.</li>
<li>Click Apply to Account and enter the claim code when prompted.</li>
<li>Gift card funds will be applied automatically to eligible orders during the checkout process.</li>
<li>You must pay for any remaining balance on your order with another payment method.</li>
</ol>
<p class="size-12">Your gift card claim code may also be entered when prompted during checkout.
To redeem your gift card using the Amazon.com 1-Click&reg; service, first add the gift card
funds to Your Account.</p>
<p class="size-12">If you have questions about redeeming your gift card, please visit
<a ng-click="$root.openExternalLink('https://www.amazon.com/gc-redeem')">www.amazon.com/gc-redeem</a>.
If you have questions regarding the BitPay offer, please contact BitPay.</p>
</div>
</div> </div>
</div> </div>

View file

@ -16,7 +16,7 @@
<ion-content overflow-scroll="true"> <ion-content overflow-scroll="true">
<div class="modal-content fix-modals-touch"> <div class="modal-content fix-modals-touch">
<div class="header-modal bg-gray text-center"> <div class="header-modal text-center">
<img src="img/a_generic.jpg" alt="Amazon.com Gift Card" width="230" ng-click="refreshGiftCard()"> <img src="img/a_generic.jpg" alt="Amazon.com Gift Card" width="230" ng-click="refreshGiftCard()">
@ -37,12 +37,12 @@
</button> </button>
</div> </div>
<div class="size-12 m10t text-center" ng-show="card.cardInfo.cardStatus == 'Fulfilled'"> <div class="text-secondary text-center" ng-if="card.cardInfo.cardStatus == 'RefundedToPurchaser'">
| <a Refunded to purchaser
ng-click="$root.openExternalLink('https://www.amazon.com/gp/css/gc/payment/view-gc-balance?claimCode=' + card.gcClaimCode, '_system')"> </div>
Apply to Account
</a> | <div class="size-12 m10t text-center">
<a ng-click="$root.openExternalLink('http://www.amazon.com/gc-redeem')">How to Use</a> | <a ng-click="$root.openExternalLink(card.bitpayInvoiceUrl)">BitPay Invoice</a>
</div> </div>
</div> </div>
</div> </div>
@ -67,76 +67,7 @@
</div> </div>
</div> </div>
<div class="size-12 white line-t p10" ng-show="card.gcClaimCode && card.cardInfo.cardStatus == 'Fulfilled'"> <div class="size-12 white p15 m30v">
<div class="text-bold m10b">To redeem your gift card, follow these steps:</div>
<ol class="amazon-list size-12">
<li>Visit <a ng-click="$root.openExternalLink('https://www.amazon.com/gc')">www.amazon.com/gc</a>.</li>
<li>Click Apply to Account and enter the claim code when prompted.</li>
<li>Gift card funds will be applied automatically to eligible orders during the checkout process.</li>
<li>You must pay for any remaining balance on your order with another payment method.</li>
</ol>
<p class="size-12">Your gift card claim code may also be entered when prompted during checkout.
To redeem your gift card using the Amazon.com 1-Click&reg; service, first add the gift card
funds to Your Account.</p>
<p class="size-12">If you have questions about redeeming your gift card, please visit
<a ng-click="$root.openExternalLink('https://www.amazon.com/gc-redeem')">www.amazon.com/gc-redeem</a>.
If you have questions regarding the BitPay offer, please contact BitPay.</p>
</div>
<ul class="no-bullet size-14">
<h4 class="title">Details</h4>
<li class="line-b p10 oh">
<span class="text-gray">Card status</span>
<span class="text-success right" ng-if="card.cardInfo.cardStatus == 'Fulfilled'">Fulfilled</span>
<span class="text-secondary right" ng-if="card.cardInfo.cardStatus == 'RefundedToPurchaser'">Refunded to purchaser</span>
<span class="text-warning right" ng-if="card.cardInfo.cardStatus == 'Expired'">Expired</span>
</li>
<li class="line-b p10 oh">
<span class="text-gray">Created at</span>
<span class="test-gray right">{{card.date * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}}</span>
</li>
<li class="line-b p10 oh">
<span class="text-gray">Creation status</span>
<span class="text-success right" ng-if="card.status == 'SUCCESS'">Success</span>
<span class="text-secondary right" ng-if="card.status == 'RESEND'">Resend is required</span>
<span class="text-warning right" ng-if="card.status == 'FAILURE'">Error</span>
<span class="text-warning right" ng-if="card.status == 'REFUND'">Refunded</span>
</li>
<li class="line-b p10 oh pointer" ng-click="$root.openExternalLink(card.bitpayInvoiceUrl)">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span class="text-gray">BitPay Invoice</span>
<span class="text-gray right enable_text_select">{{card.bitpayInvoiceId}}</span>
</li>
</ul>
<div class="row m20t"
ng-show="card.status == 'FAILURE' || card.cardInfo.cardStatus == 'RefundedToPurchaser' || card.cardInfo.cardStatus == 'Expired'">
<div class="columns text-center">
<p class="size-12 text-gray">
This action will remove the gift card
</p>
<button class="button outline round dark-gray tiny"
ng-click="remove()">
<i class="fi-x"></i>
Remove
</button>
</div>
</div>
<div class="row m20t" ng-show="card.status == 'SUCCESS' && card.cardInfo.cardStatus == 'Fulfilled'">
<div class="columns text-center">
<p class="size-12 text-gray">
This action will cancel the gift card
</p>
<button class="button outline round dark-gray tiny"
ng-click="cancelGiftCard()">
<i class="fi-x"></i>
Cancel
</button>
</div>
</div>
<div class="size-12 white p15 m20t">
*Amazon.com Gift Cards (&quot;GCs&quot;) sold by BitPay, Inc., an authorized and independent *Amazon.com Gift Cards (&quot;GCs&quot;) 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. 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 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. Amazon.com, Inc. or its affiliates. No expiration date or service fees.
</div> </div>
<ul class="no-bullet size-14">
<li class="line-b p10 oh pointer" ng-show="card.status == 'SUCCESS' && card.cardInfo.cardStatus == 'Fulfilled'" ng-click="cancelGiftCard()">
<span class="text-warning">Cancel gift card</span>
</li>
<li class="line-b p10 oh pointer" ng-show="card.status == 'FAILURE' || card.cardInfo.cardStatus == 'RefundedToPurchaser'
|| card.cardInfo.cardStatus == 'Expired'" ng-click="remove()">
<span class="text-warning">Remove gift card</span>
</li>
</ul>
<div class="extra-margin-bottom"></div> <div class="extra-margin-bottom"></div>
</div> </div>
</ion-content> </ion-content>

View file

@ -5,10 +5,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
var self = this; var self = this;
var client; var client;
var limitsAllowed = {
min: 0.01,
max: 2000
};
var handleEncryptedWallet = function(client, cb) { var handleEncryptedWallet = function(client, cb) {
if (!walletService.isEncrypted(client)) return 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) { $scope.openWalletsModal = function(wallets) {
self.error = null; self.error = null;
@ -82,14 +70,16 @@ console.log('[buyAmazon.js:37]'); //TODO
var walletSettings = configWallet.settings; var walletSettings = configWallet.settings;
ongoingProcess.set('Creating invoice...', true); ongoingProcess.set('Processing Transaction...', true);
$timeout(function() { $timeout(function() {
amazonService.createBitPayInvoice(dataSrc, function(err, data) { amazonService.createBitPayInvoice(dataSrc, function(err, data) {
ongoingProcess.set('Creating invoice...', false);
if (err) { if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwsError.msg(err); self.error = bwsError.msg(err);
$scope.$apply(); $timeout(function() {
$scope.$digest();
});
return; return;
} }
@ -115,22 +105,24 @@ console.log('[buyAmazon.js:37]'); //TODO
feeLevel: walletSettings.feeLevel || 'normal' feeLevel: walletSettings.feeLevel || 'normal'
}; };
ongoingProcess.set('Creating transaction...', true);
walletService.createTx(client, txp, function(err, createdTxp) { walletService.createTx(client, txp, function(err, createdTxp) {
ongoingProcess.set('Creating transaction...', false); ongoingProcess.set('Processing Transaction...', false);
if (err) { if (err) {
self.error = bwsError.msg(err); self.error = bwsError.msg(err);
$scope.$apply(); $timeout(function() {
$scope.$digest();
});
return; return;
} }
$scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) { $scope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) {
if (accept) { if (accept) {
ongoingProcess.set('Sending bitcoin...', true);
self.confirmTx(createdTxp, function(err, tx) { self.confirmTx(createdTxp, function(err, tx) {
ongoingProcess.set('Sending bitcoin...', false);
if (err) { if (err) {
ongoingProcess.set('Processing Transaction...', false);
self.error = bwsError.msg(err); self.error = bwsError.msg(err);
$scope.$apply(); $timeout(function() {
$scope.$digest();
});
return; return;
} }
var gift = { var gift = {
@ -139,13 +131,15 @@ console.log('[buyAmazon.js:37]'); //TODO
bitpayInvoiceId: data.data.id, bitpayInvoiceId: data.data.id,
bitpayInvoiceUrl: data.data.url bitpayInvoiceUrl: data.data.url
}; };
ongoingProcess.set('Creating gift card...', true); ongoingProcess.set('Processing Transaction...', true);
amazonService.createGiftCard(gift, function(err, giftCard) { amazonService.createGiftCard(gift, function(err, giftCard) {
ongoingProcess.set('Creating gift card...', false); ongoingProcess.set('Processing Transaction...', false);
if (err) { if (err) {
self.error = bwsError.msg(err); self.error = bwsError.msg(err);
self.errorInfo = gift; self.errorInfo = gift;
$scope.$apply(); $timeout(function() {
$scope.$digest();
});
return; return;
} }
amazonService.setAmountByDay(dataSrc.price); amazonService.setAmountByDay(dataSrc.price);
@ -176,6 +170,7 @@ console.log('[buyAmazon.js:37]'); //TODO
return bwsError.cb(err, null, cb); return bwsError.cb(err, null, cb);
} }
ongoingProcess.set('Processing Transaction...', true);
walletService.publishTx(client, txp, function(err, publishedTxp) { walletService.publishTx(client, txp, function(err, publishedTxp) {
if (err) { if (err) {
$log.debug(err); $log.debug(err);

View file

@ -785,6 +785,10 @@ ul.manage li {
margin: 20px 0; margin: 20px 0;
} }
.m30v {
margin: 30px 0;
}
.m30a { .m30a {
margin: 30px auto; margin: 30px auto;
} }