Refactor Buy/Sell Glidera. Fix 2FA Code. Clean amount/confirm views
This commit is contained in:
parent
4ec340640e
commit
c223de2c63
12 changed files with 802 additions and 320 deletions
103
www/views/buyGlidera.html
Normal file
103
www/views/buyGlidera.html
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<ion-view id="glidera" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Buy bitcoin</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- BUY -->
|
||||
<div class="list" ng-if="buyInfo">
|
||||
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="35" class="item-img-buy">
|
||||
<span>Buying</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
<div class="alternative">
|
||||
<span ng-show="!isFiat">{{buyInfo.subtotal}} {{buyInfo.currency}}</span>
|
||||
<span ng-show="isFiat">{{buyInfo.qty}} BTC</span>
|
||||
@ ${{buyInfo.price}} per BTC
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label">Receive in</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
|
||||
<div class="item item-divider">
|
||||
Transaction details
|
||||
</div>
|
||||
<div class="item">
|
||||
Expires
|
||||
<span class="item-note">
|
||||
{{buyInfo.expires | amCalendar}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Fees
|
||||
<span class="item-note">
|
||||
{{buyInfo.fees}} {{buyInfo.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Total to pay
|
||||
<span class="item-note total-amount">
|
||||
{{buyInfo.total}} {{buyInfo.currency}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!buyInfo || !wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova && buyInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!buyInfo">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!buyInfo || !wallet"
|
||||
ng-if="isCordova && buyInfo"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!buyInfo">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span>Bought</span>
|
||||
<div class="m10 size-14">
|
||||
A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
|
|
@ -12,10 +12,8 @@
|
|||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<img src="img/icon-tx-sent-outline.svg">
|
||||
<span translate ng-if="!useSendMax && !isGlidera">Sending</span>
|
||||
<span translate ng-if="!useSendMax">Sending</span>
|
||||
<span translate ng-if="useSendMax">Sending maximum amount</span>
|
||||
<span ng-if="isGlidera == 'buy'">Buying</span>
|
||||
<span ng-if="isGlidera == 'sell'">Selling</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{displayAmount || '...'}} <span class="unit">{{displayUnit}}</span></div>
|
||||
|
|
@ -31,16 +29,13 @@
|
|||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="label" ng-if="!isGlidera" translate>To</span>
|
||||
<span class="label" ng-if="isGlidera == 'buy'">From</span>
|
||||
<span class="label" ng-if="isGlidera == 'sell'">To</span>
|
||||
<span class="label" translate>To</span>
|
||||
<span class="payment-proposal-to">
|
||||
<img ng-if="!cardId && !isGiftCard && !isGlidera" src="img/icon-bitcoin-small.svg">
|
||||
<img ng-if="!cardId && !isGiftCard" src="img/icon-bitcoin-small.svg">
|
||||
<img ng-if="cardId" src="img/icon-card.svg" width="34">
|
||||
<i ng-if="isGiftCard" class="icon big-icon-svg">
|
||||
<div class="bg icon-amazon"></div>
|
||||
</i>
|
||||
<img ng-if="isGlidera" src="img/glidera-logo.png" width="90"/>
|
||||
|
||||
<div copy-to-clipboard="toAddress" ng-if="!paypro" class="ellipsis">
|
||||
<contact ng-if="!toName" address="{{toAddress}}"></contact>
|
||||
|
|
@ -58,9 +53,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<a class="item item-icon-right" ng-hide="!useSendMax && (insufficientFunds || noMatchingWallet)" ng-click="showWalletSelector()">
|
||||
<span class="label" ng-if="!isGlidera" translate>From</span>
|
||||
<span class="label" ng-if="isGlidera == 'buy'">To</span>
|
||||
<span class="label" ng-if="isGlidera == 'sell'">From</span>
|
||||
<span class="label" translate>From</span>
|
||||
<div class="wallet" ng-if="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': wallet.color}" class="bg"/>
|
||||
|
|
@ -75,47 +68,19 @@
|
|||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<a class="item single-line item-icon-right" ng-if="!insufficientFunds && !noMatchingWallet && !isGlidera" ng-click="showDescriptionPopup()">
|
||||
<a class="item single-line item-icon-right" ng-if="!insufficientFunds && !noMatchingWallet" ng-click="showDescriptionPopup()">
|
||||
<span class="label" translate>Add Memo</span>
|
||||
<span class="item-note m10l">
|
||||
{{description}}
|
||||
</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<div class="item single-line" ng-if="!insufficientFunds && !noMatchingWallet && !isGlidera">
|
||||
<div class="item single-line" ng-if="!insufficientFunds && !noMatchingWallet">
|
||||
<span class="label">{{'Fee' | translate}}: {{feeLevel | translate}}</span>
|
||||
<span class="item-note">
|
||||
{{fee || '...'}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item" ng-show="isGlidera == 'buy'">
|
||||
<span class="label">Information</span>
|
||||
<div class="glidera-explanation">
|
||||
<div class="glidera-description" ng-show="buyPrice.qty">
|
||||
Buy {{buyPrice.subtotal|currency:'':2}} {{buyPrice.currency}} in Bitcoin at {{buyPrice.price}} {{buyPrice.currency}}/BTC
|
||||
</div>
|
||||
<div class="glidera-description">
|
||||
Fiat will be immediately withdrawn from your bank account.
|
||||
</div>
|
||||
<div class="glidera-description">
|
||||
The bitcoins will be purchased and deposited to "{{wallet.name || '...' }}" wallet in 2-4 business days.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item" ng-show="isGlidera == 'sell'">
|
||||
<span class="label">Information</span>
|
||||
<div class="glidera-explanation">
|
||||
<div class="glidera-description" ng-show="sellPrice.qty">
|
||||
Sell {{sellPrice.subtotal|currency:'':2}} {{sellPrice.currency}} in Bitcoin at {{sellPrice.price|currency:'':2}} {{sellPrice.currency}}/BTC
|
||||
</div>
|
||||
<div class="glidera-description">
|
||||
Fiat will be deposited in your bank account in 4-6 business days.
|
||||
</div>
|
||||
<div class="glidera-description">
|
||||
Bitcoins will be immediately sent from your "{{wallet.name || '...' }}" wallet to Glidera.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center" ng-show="noMatchingWallet">
|
||||
<span class="badge badge-energized" translate>No wallets available</span>
|
||||
</div>
|
||||
|
|
@ -150,10 +115,6 @@
|
|||
<span ng-show="wallet.m == 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Payment Sent</span>
|
||||
<span ng-show="wallet.m > 1 && (wallet.canSign() || wallet.isPrivKeyExternal())" translate>Proposal Created</span>
|
||||
<span ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()" translate>Transaction created</span>
|
||||
<div ng-show="isGlidera" class="glidera-success">
|
||||
<span ng-show="isGlidera == 'buy'">A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day</span>
|
||||
<span ng-show="isGlidera == 'sell'">A transfer has been initiated to your bank account. Should arrive in 4-6 business days</span>
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
<wallet-selector
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
<span ng-hide="showOauthForm">Enter Code</span>
|
||||
<span ng-show="showOauthForm">Restart</span>
|
||||
</button>
|
||||
<button class="button button-clear button-small ng-hide" ng-show="account.token && account.status && !account.status.userCanTransact" ng-click="retry()">
|
||||
<button class="button button-clear button-small ng-hide" ng-show="account.token && account.status &&
|
||||
!account.status.userCanTransact" ng-click="update()">
|
||||
Refresh
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
|
|
@ -58,13 +59,13 @@
|
|||
|
||||
<ion-content class="ng-hide" ng-show="account.token && account.status && account.status.userCanTransact">
|
||||
<div class="text-center m20v">
|
||||
<img src="img/glidera-logo.png" width="170">
|
||||
<img src="img/glidera-logo.png" width="170" ng-click="update()">
|
||||
</div>
|
||||
|
||||
<div class="list card">
|
||||
<a ng-show="account.status.userCanBuy"
|
||||
class="item item-icon-right"
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'buy', glideraAccessToken: account.token})">
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({nextStep: 'tabs.buyandsell.glidera.buy', currency: currency})">
|
||||
<img src="img/buy-bitcoin.svg" alt="buy bitcoin" width="25" class="item-img-buy">
|
||||
Buy Bitcoin
|
||||
<span class="item-note" ng-show="account.price.buy">
|
||||
|
|
@ -74,7 +75,7 @@
|
|||
</a>
|
||||
<a class="item item-icon-right"
|
||||
ng-show="account.status.userCanSell"
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({isGlidera: 'sell', glideraAccessToken: account.token})">
|
||||
href ui-sref="tabs.buyandsell.glidera.amount({nextStep: 'tabs.buyandsell.glidera.sell', currency: currency})">
|
||||
<img src="img/sell-bitcoin.svg" alt="buy bitcoin" width="25" class="item-img-sell">
|
||||
Sell Bitcoin
|
||||
<span class="item-note" ng-show="account.price.sell">
|
||||
|
|
|
|||
104
www/views/sellGlidera.html
Normal file
104
www/views/sellGlidera.html
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<ion-view id="glidera" hide-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-back-button>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>Sell bitcoin</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<!-- SELL -->
|
||||
<div class="list" ng-if="sellInfo">
|
||||
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
<img src="img/sell-bitcoin.svg" alt="sell bitcoin" width="35" class="item-img-sell">
|
||||
<span>Selling</span>
|
||||
</div>
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{amountUnitStr}}</div>
|
||||
<div class="alternative">
|
||||
<span ng-show="!isFiat">{{sellInfo.subtotal}} {{sellInfo.currency}}</span>
|
||||
<span ng-show="isFiat">{{sellInfo.qty}} BTC</span>
|
||||
@ ${{sellInfo.price}} per BTC
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
|
||||
<div class="item item-icon-right" ng-click="showWalletSelector()">
|
||||
<div class="label">From</div>
|
||||
<div class="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
<img src="img/icon-wallet.svg" ng-style="{'background-color': wallet.color}" class="bg">
|
||||
</i>
|
||||
{{wallet ? wallet.name : '...'}}
|
||||
</div>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</div>
|
||||
|
||||
<div class="item item-divider">
|
||||
Transaction details
|
||||
</div>
|
||||
<div class="item">
|
||||
Expires
|
||||
<span class="item-note">
|
||||
{{sellInfo.expires | amCalendar}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Fees
|
||||
<span class="item-note">
|
||||
{{sellInfo.fees}} {{sellInfo.currency}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
Total to receive
|
||||
<span class="item-note total-amount">
|
||||
{{sellInfo.total}} {{sellInfo.currency}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!sellInfo || !wallet"
|
||||
ng-click="sellConfirm()"
|
||||
ng-if="!isCordova && sellInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!sellInfo">
|
||||
Confirm sale
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!sellInfo || !wallet"
|
||||
ng-if="isCordova && sellInfo"
|
||||
slide-on-confirm="sellConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!sellInfo">
|
||||
Slide to sell
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
slide-success-show="sendStatus === 'success'"
|
||||
slide-success-on-confirm="goBackHome()"
|
||||
slide-success-hide-on-confirm="true">
|
||||
<span>Funds sent to Glidera Account</span>
|
||||
<div class="m10 size-14">
|
||||
The transaction is not yet confirmed, and will show as "Pending" in your Activity. The bitcoin sale will be
|
||||
completed automatically once it is confirmed by Glidera.
|
||||
</div>
|
||||
</slide-to-accept-success>
|
||||
|
||||
<wallet-selector
|
||||
wallet-selector-title="walletSelectorTitle"
|
||||
wallet-selector-wallets="wallets"
|
||||
wallet-selector-selected-wallet="wallet"
|
||||
wallet-selector-show="showWallets"
|
||||
wallet-selector-on-select="onWalletSelect">
|
||||
</wallet-selector>
|
||||
</ion-view>
|
||||
Loading…
Add table
Add a link
Reference in a new issue