mirror of https://github.com/BTCPrivate/copay.git
146 lines
5.8 KiB
HTML
146 lines
5.8 KiB
HTML
<ion-view>
|
|
<ion-nav-bar class="bar-stable">
|
|
<ion-nav-buttons side="primary">
|
|
<button class="button no-border" ui-sref="glidera.main">
|
|
<i class="icon ion-chevron-left"></i> Back
|
|
</button>
|
|
</ion-nav-buttons>
|
|
<ion-nav-title>Buy</ion-nav-title>
|
|
</ion-nav-bar>
|
|
|
|
<ion-content ng-controller="buyGlideraController as buy" ng-init="init()">
|
|
|
|
<div class="box-notification text-center size-12 text-warning" ng-show="network == 'testnet'">
|
|
<i class="fi-info"></i>
|
|
Testnet wallets only work with Glidera Sandbox Accounts
|
|
</div>
|
|
|
|
<h5 class="padding" ng-show="limits && !buy.show2faCodeInput && !buy.success">
|
|
<span class="text-light">Daily buy limit</span>:
|
|
{{limits.dailyBuy|currency:'':2}} {{limits.currency}}
|
|
(remaining {{limits.dailyBuyRemaining|currency:'':2}} {{limits.currency}})
|
|
<br>
|
|
<span class="text-light">Monthly buy limit</span>:
|
|
{{limits.monthlyBuy|currency:'':2}} {{limits.currency}}
|
|
(remaining {{limits.monthlyBuyRemaining|currency:'':2}} {{limits.currency}})
|
|
</h5>
|
|
|
|
<div class="box-notification m20b" ng-show="limits.transactDisabledPendingFirstTransaction && !buy.success">
|
|
<span class="text-warning">
|
|
This operation was disabled because you have a pending first transaction
|
|
</span>
|
|
</div>
|
|
|
|
<div ng-show="!buy.show2faCodeInput && !buy.success">
|
|
|
|
<form name="buyPriceForm" ng-if="token"
|
|
ng-submit="buy.get2faCode(token)" novalidate>
|
|
|
|
<div class="list">
|
|
|
|
<label class="item item-input item-stacked-label">
|
|
<span class="input-label">Wallet</span>
|
|
<input type="text"
|
|
id="address"
|
|
name="address"
|
|
ng-disabled="buy.selectedWalletId"
|
|
ng-attr-placeholder="{{'Choose your destination wallet'}}"
|
|
ng-model="buy.selectedWalletName" required>
|
|
<a on-tap="openWalletsModal(buy.allWallets)">
|
|
<i class="icon ion-briefcase size-18"></i>
|
|
</a>
|
|
</label>
|
|
|
|
|
|
<label class="item item-input item-stacked-label">
|
|
<span class="input-label">Amount in {{showAlternative ? 'USD' : 'BTC'}}</span>
|
|
<input ng-show="!showAlternative"
|
|
type="number"
|
|
id="qty" ignore-mouse-wheel
|
|
name="qty"
|
|
ng-attr-placeholder="{{'Amount'}}"
|
|
ng-minlength="0.00000001"
|
|
ng-maxlength="10000000000"
|
|
ng-model="qty"
|
|
autocomplete="off"
|
|
ng-change="buy.getBuyPrice(token, {'qty': qty})">
|
|
|
|
<input ng-show="showAlternative"
|
|
type="number"
|
|
id="fiat" ignore-mouse-wheel
|
|
name="fiat"
|
|
ng-attr-placeholder="{{'Amount'}}"
|
|
ng-model="fiat"
|
|
autocomplete="off"
|
|
ng-change="buy.getBuyPrice(token, {'fiat': fiat})">
|
|
|
|
<a ng-show="!showAlternative"
|
|
class="postfix"
|
|
on-tap="showAlternative = true; qty = null; buy.buyPrice = null">BTC</a>
|
|
<a ng-show="showAlternative"
|
|
class="postfix"
|
|
on-tap="showAlternative = false; fiat = null; buy.buyPrice = null">USD</a>
|
|
</label>
|
|
</div>
|
|
|
|
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && buy.buyPrice.qty">
|
|
Buy
|
|
<span ng-show="qty">{{buy.buyPrice.subtotal|currency:'':2}} {{buy.buyPrice.currency}} in Bitcoin</span>
|
|
<span ng-show="fiat">{{buy.buyPrice.qty}} BTC</span>
|
|
at {{buy.buyPrice.price}} {{buy.buyPrice.currency}}/BTC
|
|
</div>
|
|
<div class="text-center text-gray size-12 m20b" ng-show="!buy.gettingBuyPrice && !buy.buyPrice.qty">
|
|
(Enter the amount to get the exchange rate)
|
|
</div>
|
|
|
|
<div class="text-center text-gray size-12 m20b" ng-show="buy.gettingBuyPrice">
|
|
...
|
|
</div>
|
|
|
|
<button class="button button-block"
|
|
type="submit"
|
|
ng-disabled="limits.transactDisabledPendingFirstTransaction || !buy.buyPrice.qty || !buy.selectedWalletId || buy.loading">
|
|
Continue
|
|
</button>
|
|
</form>
|
|
</div>
|
|
<div ng-show="buy.show2faCodeInput && !buy.success">
|
|
<div class="m10t text-center">
|
|
{{buy.buyPrice.subtotal|currency:'':2}} {{buy.buyPrice.currency}} → {{buy.buyPrice.qty}} BTC
|
|
<p class="m20t">
|
|
A SMS containing a confirmation code was sent to your phone. <br>
|
|
Please, enter the code below
|
|
</p>
|
|
<form name="buyForm"
|
|
ng-submit="buy.sendRequest(token, permissions, twoFaCode)" novalidate>
|
|
<div class="list">
|
|
<label class="item item-input">
|
|
<input type="number" ng-model="twoFaCode" placeholder="2FA Code" required ignore-mouse-wheel>
|
|
</label>
|
|
</div>
|
|
<button class="button button-block"
|
|
type="submit" ng-disabled="buyForm.$invalid || buy.loading">
|
|
Buy
|
|
</button>
|
|
</form>
|
|
<p class="m10t size-12 text-gray">
|
|
Fiat will be immediately withdrawn from your bank account. The bitcoins will be purchased and deposited to your wallet in 2-4 business days.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="box-notification m20b" ng-show="buy.error && !buy.success">
|
|
<span class="text-warning">
|
|
{{buy.error}}
|
|
</span>
|
|
</div>
|
|
<div class="text-center" ng-show="buy.success">
|
|
<h1>Purchase initiated</h1>
|
|
<p class="text-gray">
|
|
A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business days.
|
|
</p>
|
|
|
|
<button class="button button-block" ui-sref="glidera.main">OK</button>
|
|
</div>
|
|
</ion-content>
|
|
</ion-view>
|