mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #1 from cmgustavo/ref/design-01
Adds next step for external services
This commit is contained in:
commit
f1805b2080
|
@ -12,7 +12,7 @@
|
|||
<ion-pane>
|
||||
<ion-content class="calculator" scroll="false" class="amount" ng-controller="amountController" ng-init="init()">
|
||||
|
||||
<div class="list card">
|
||||
<div class="card">
|
||||
|
||||
<div class="item item-divider">
|
||||
Recipient
|
||||
|
@ -22,7 +22,9 @@
|
|||
<i class="icon ion-ios-person-outline"></i>
|
||||
{{toName || toAddress}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="item item-divider">
|
||||
Amount
|
||||
</div>
|
||||
|
@ -41,7 +43,6 @@
|
|||
{{globalResult}} <span class="label gray text-white radius">{{alternativeResult || '0.00'}} {{unitName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="button-calc">
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<ion-view>
|
||||
<ion-nav-bar class="bar-stable">
|
||||
<ion-nav-buttons side="primary">
|
||||
<button class="button no-border" ui-sref="tabs.home">
|
||||
Close
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-nav-title translate>Buy and sell</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<ion-item class="item" ui-sref="glidera.main">
|
||||
<img src="img/glidera-logo.png" width="100">
|
||||
</ion-item>
|
||||
<ion-item class="item" ui-sref="coinbase.main">
|
||||
<img src="img/coinbase-logo.png" width="100"> TODO
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-view>
|
|
@ -4,21 +4,20 @@
|
|||
<ion-nav-title>Home</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="padding" ng-controller="tabHomeController">
|
||||
<h3 class="title" translate>Recent Activity
|
||||
</h3>
|
||||
<ion-content class="padding" ng-controller="tabHomeController" ng-init="updateAllWallets(); nextStep()">
|
||||
|
||||
<div ng-if="fetchingNotifications" class="updatingHistory">
|
||||
<div class="text-center">
|
||||
<ion-spinner class="spinner-dark" icon="lines"></ion-spinner>
|
||||
<div class="card">
|
||||
<div class="item item-divider">
|
||||
Recent Activity
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="!fetchingNotifications">
|
||||
<div class="list card">
|
||||
<div class="item item-icon-left" ng-repeat="x in notifications" ng-click="x.action()">
|
||||
<div ng-if="fetchingNotifications" class="item text-center">
|
||||
<ion-spinner icon="lines"></ion-spinner>
|
||||
<div translate>Updating activity. Please stand by</div>
|
||||
</div>
|
||||
<div ng-if="!fetchingNotifications">
|
||||
<a class="item item-icon-left" ng-repeat="x in notifications" ng-click="x.action()">
|
||||
<span ng-include="'views/includes/walletActivity.html'"></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a class="item text-center" ui-sref="activity" ng-show="notificationsMore">
|
||||
|
||||
|
@ -32,56 +31,62 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-80">
|
||||
<h3 translate>Wallets</h3>
|
||||
<div class="card">
|
||||
<div class="item item-divider item-icon-right">
|
||||
Wallets
|
||||
<i class="icon ion-ios-plus-empty" ui-sref="add.main"></i>
|
||||
</div>
|
||||
<div class="col text-right" ui-sref="add.main">
|
||||
<i class="size-32 icon ion-ios-plus-empty"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list card" ng-init="updateAllWallets()">
|
||||
<div class="item" ng-if="!wallets[0]">
|
||||
<span translate>No Wallet</span>
|
||||
</div>
|
||||
<div ng-repeat="item in wallets track by $index"
|
||||
class="item item-icon-left"
|
||||
ui-sref="wallet.details({'walletId': item.id})">
|
||||
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
||||
{{item.name || item.id}}
|
||||
<span ng-show="item.n > 1" class="text-light">
|
||||
{{item.m}}-of-{{item.n}}
|
||||
</span>
|
||||
<span class="badge badge-assertive" ng-show="!item.isComplete()" translate>
|
||||
Incomplete
|
||||
</span>
|
||||
<span class="item-note" ng-show="item.isComplete()">
|
||||
{{item.status.availableBalanceStr}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="glideraEnabled || coinbaseEnabled">
|
||||
<h3 class="title" translate>Buy & Sell Bitcoin</h3>
|
||||
<div class="card">
|
||||
<div ng-show="glideraEnabled" ui-sref="glidera.main" class="item">
|
||||
<img src="img/glidera-logo.png" width="90">
|
||||
</div>
|
||||
<div ng-show="coinbaseEnabled" ui-sref="exchange.coinbase" class="item">
|
||||
<img src="img/coinbase-logo.png" width="90"> TODO
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="title" translate>Next steps</h3>
|
||||
<div class="card">
|
||||
<div ui-sref="bitpayCard.main" ng-show="bitpayCardEnabled" class="item item-icon-left">
|
||||
<a ng-repeat="item in wallets track by $index"
|
||||
class="item item-icon-left"
|
||||
ui-sref="wallet.details({'walletId': item.id})">
|
||||
<i class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
||||
{{item.name || item.id}}
|
||||
<span ng-show="item.n > 1" class="text-light">
|
||||
{{item.m}}-of-{{item.n}}
|
||||
</span>
|
||||
<span class="badge badge-assertive" ng-show="!item.isComplete()" translate>
|
||||
Incomplete
|
||||
</span>
|
||||
<span class="item-note" ng-show="item.isComplete()">
|
||||
{{item.status.availableBalanceStr}}
|
||||
</span>
|
||||
</a>
|
||||
<a ui-sref="bitpayCard.main" ng-show="externalServices.BitpayCard" class="item item-icon-left">
|
||||
<i class="icon ion-card"></i>BitPay Card
|
||||
</div>
|
||||
<div ui-sref="amazon.main" class="item item-icon-left">
|
||||
</a>
|
||||
<a ui-sref="amazon.main" ng-show="externalServices.AmazonGiftCards" class="item item-icon-left">
|
||||
<i class="icon ion-ios-cart"></i>Gift Cards
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card" ng-show="externalServices.BuyAndSell && (glideraEnabled || coinbaseEnabled)">
|
||||
<div class="item item-divider">
|
||||
Buy & Sell Bitcoin
|
||||
</div>
|
||||
<a ng-show="glideraEnabled" ui-sref="glidera.main" class="item">
|
||||
<img src="img/glidera-logo.png" width="90">
|
||||
</a>
|
||||
<a ng-show="coinbaseEnabled" ui-sref="exchange.coinbase" class="item">
|
||||
<img src="img/coinbase-logo.png" width="90"> TODO
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card" ng-show="!externalServices.AmazonGiftCards || !externalServices.BitpayCard || !externalServices.BuyAndSell">
|
||||
<div class="item item-divider">
|
||||
Next steps
|
||||
</div>
|
||||
<a ui-sref="bitpayCard.main" ng-show="!externalServices.BitpayCard" class="item item-icon-left">
|
||||
<i class="icon ion-card"></i>Add BitPay Card
|
||||
</a>
|
||||
<a ng-show="!externalServices.BuyAndSell" ui-sref="buyandsell" class="item item-icon-left">
|
||||
<i class="icon ion-bag"></i>Buy and Sell Bitcoin
|
||||
</a>
|
||||
<a ui-sref="amazon.main" ng-show="!externalServices.AmazonGiftCards" class="item item-icon-left">
|
||||
<i class="icon ion-ios-cart"></i>Buy a Gift Cards
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
|
|
@ -4,33 +4,31 @@
|
|||
<ion-nav-title>Send</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content class="send" ng-controller="tabSendController" ng-init="init()">
|
||||
<ion-content ng-controller="tabSendController" ng-init="init()">
|
||||
|
||||
<div class="padding">
|
||||
<h2>Recipient</h2>
|
||||
|
||||
<label class="item item-input">
|
||||
<i class="icon ion-search placeholder-icon"></i>
|
||||
<input type="text" placeholder="Recipient" ng-model="search" ng-model-onblur ng-change="findContact(search)">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-80">
|
||||
<h3>Contacts & Wallets</h3>
|
||||
<div class="card">
|
||||
<div class="item item-divider">
|
||||
Recipient
|
||||
</div>
|
||||
<div class="col col-20 text-right">
|
||||
<a class="button button-light" ng-click="openAddressbookModal()">
|
||||
<i class="size-36 icon ion-person-add"></i>
|
||||
</a>
|
||||
<div class="list list-inset">
|
||||
<label class="item item-input">
|
||||
<i class="icon ion-search placeholder-icon"></i>
|
||||
<input type="text"
|
||||
placeholder="Search or enter bitcoin address"
|
||||
ng-model="search"
|
||||
ng-change="findContact(search)"
|
||||
ng-model-onblur>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list card padding text-center" ng-if="!list[0]">
|
||||
<span translate>No Wallet - Contact</span>
|
||||
</div>
|
||||
|
||||
<div class="list card" ng-if="list[0]">
|
||||
<div class="card" ng-if="list[0]">
|
||||
<div class="item item-divider item-icon-right">
|
||||
Contacts & Wallets
|
||||
<i class="icon ion-person-add" ng-click="openAddressbookModal()"></i>
|
||||
</div>
|
||||
<div class="item text-center" ng-show="!list[0]" translate>No Wallet - Contact</div>
|
||||
<a class="item item-icon-left" ng-repeat="item in list" ng-click="goToAmount(item)">
|
||||
<i ng-show="item.isWallet" class="icon ion-briefcase size-21" ng-style="{'color':item.color}"></i>
|
||||
<i ng-show="!item.isWallet" class="icon ion-ios-person-outline"></i>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<ion-nav-title>{{wallet.name}}</ion-nav-title>
|
||||
<ion-nav-buttons side="primary">
|
||||
<button class="button no-border" ui-sref="tabs.home">
|
||||
<i class="icon ion-chevron-left"></i> Close
|
||||
Close
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-nav-buttons side="secondary">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo) {
|
||||
function($rootScope, $timeout, $scope, $state, lodash, profileService, walletService, configService, txFormatService, $ionicModal, $log, platformInfo, storageService) {
|
||||
|
||||
var setNotifications = function(notifications) {
|
||||
var n = walletService.processNotifications(notifications, 5);
|
||||
|
@ -68,7 +68,14 @@ console.log('[tab-home.js.39]', wallet.name, n); //TODO
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
$scope.externalServices = {};
|
||||
$scope.nextStep = function() {
|
||||
lodash.each(['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'], function(service) {
|
||||
storageService.getNextStep(service, function(err, value) {
|
||||
$scope.externalServices[service] = value ? true : false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.bitpayCardEnabled = true; // TODO
|
||||
|
||||
|
|
|
@ -105,7 +105,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
templateUrl: 'views/starting.html'
|
||||
})
|
||||
|
||||
|
||||
.state('buyandsell', {
|
||||
url: '/buyandsell',
|
||||
templateUrl: 'views/buyandsell.html'
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
|
@ -68,6 +68,9 @@ angular.module('copayApp.services').factory('amazonService', function($http, $lo
|
|||
return cb(err);
|
||||
});
|
||||
});
|
||||
|
||||
// Show pending task from the UI
|
||||
storageService.setNextStep('AmazonGiftCards', true, function(err) {});
|
||||
};
|
||||
|
||||
root.getPendingGiftCards = function(cb) {
|
||||
|
|
|
@ -36,6 +36,8 @@ angular.module('copayApp.services').factory('bitpayCardService', function($http,
|
|||
storageService.setBitpayCard(credentials.NETWORK, user, function(err) {
|
||||
return cb(err);
|
||||
});
|
||||
// Show pending task from the UI
|
||||
storageService.setNextStep('BitpayCard', true, function(err) {});
|
||||
};
|
||||
|
||||
var _getSession = function(cb) {
|
||||
|
|
|
@ -70,6 +70,8 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
|
|||
|
||||
$http(req).then(function(data) {
|
||||
$log.info('Coinbase Authorization Access Token: SUCCESS');
|
||||
// Show pending task from the UI
|
||||
storageService.setNextStep('BuyAndSell', true, function(err) {});
|
||||
return cb(null, data.data);
|
||||
}, function(data) {
|
||||
$log.error('Coinbase Authorization Access Token: ERROR ' + data.statusText);
|
||||
|
|
|
@ -74,6 +74,8 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
|
|||
|
||||
$http(req).then(function(data) {
|
||||
$log.info('Glidera Authorization Access Token: SUCCESS');
|
||||
// Show pending task from the UI
|
||||
storageService.setNextStep('BuyAndSell', true, function(err) {});
|
||||
return cb(null, data.data);
|
||||
}, function(data) {
|
||||
$log.error('Glidera Authorization Access Token: ERROR ' + data.statusText);
|
||||
|
|
|
@ -264,6 +264,18 @@ angular.module('copayApp.services')
|
|||
storage.remove('addressbook-' + network, cb);
|
||||
};
|
||||
|
||||
root.setNextStep = function(service, status, cb) {
|
||||
storage.set('nextStep-' + service, status, cb);
|
||||
};
|
||||
|
||||
root.getNextStep = function(service, cb) {
|
||||
storage.get('nextStep-' + service, cb);
|
||||
};
|
||||
|
||||
root.removeNextStep = function(service, cb) {
|
||||
storage.remove('nextStep-' + service, cb);
|
||||
};
|
||||
|
||||
|
||||
root.checkQuota = function() {
|
||||
var block = '';
|
||||
|
|
Loading…
Reference in New Issue