Fix routes
This commit is contained in:
parent
9a9dc4b2dc
commit
10cc7fdf53
13 changed files with 76 additions and 92 deletions
|
|
@ -1,31 +1,29 @@
|
|||
<ion-view id="view-add">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>{{'Add wallet' | translate}}</ion-nav-title>
|
||||
<ion-nav-buttons side="primary">
|
||||
<button class="button back-button" ui-sref="tabs.home">
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-nav-back-button>
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create-personal">
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.create-personal">
|
||||
<h2 translate>New Personal Wallet</h2>
|
||||
<i class="icon nav-item-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.create-shared">
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.create-shared">
|
||||
<h2 translate>Create Shared Wallet</h2>
|
||||
<i class="icon nav-item-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.join">
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.join">
|
||||
<h2 translate>Join shared wallet</h2>
|
||||
<i class="icon nav-item-arrow-right"></i>
|
||||
</a>
|
||||
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.import">
|
||||
<a class="item item-remove-animate item-icon-right" type="item-text-wrap" ui-sref="tabs.add.import">
|
||||
<h2 translate>Import wallet</h2>
|
||||
<i class="icon nav-item-arrow-right"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<ion-view id="view-amount">
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-buttons side="primary">
|
||||
<button class="button back-button" ng-click="$ionicGoBack()">
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-nav-back-button>
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content scroll="false" class="amount" ng-controller="amountController" ng-init="init()">
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<ion-content scroll="false" ng-controller="confirmController" ng-init="init()">
|
||||
|
||||
<div class="card">
|
||||
<div class="list card">
|
||||
<div class="item item-text-wrap">
|
||||
<i class="icon ion-arrow-up-c"></i> <span class="text-bold size-16">Sending</span>
|
||||
<div class="text-bold size-28 m15t">{{amountStr}} </div>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<div class="item item-icon-left">
|
||||
<gravatar class="send-gravatar" name="{{toName}}" width="30" email="{{toEmail}}"></gravatar>
|
||||
<label translate>To</label> {{toAddress}}
|
||||
<span translate>To</span>: {{toAddress}}
|
||||
<p ng-show="toName">{{toName}}</p>
|
||||
|
||||
<div ng-show="_paypro" ng-click="openPPModal(_paypro)">
|
||||
|
|
@ -33,23 +33,24 @@
|
|||
{{_paypro.domain}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<label translate>From</label>
|
||||
<span class="badge badge-assertive" ng-show="notAvailable" translate>No wallet with enough funds</span>
|
||||
</div>
|
||||
<div class="text-center" ng-show="notAvailable">
|
||||
<span class="badge badge-assertive" translate>No wallet with enough funds</span>
|
||||
</div>
|
||||
|
||||
<wallets ng-if="wallets[0]" wallets="wallets"></wallets>
|
||||
<wallets ng-if="wallets[0]" wallets="wallets"></wallets>
|
||||
|
||||
<div class="list card">
|
||||
<div class="item item-icon-left item-icon-right" ng-click="showDescriptionPopup()">
|
||||
<span ng-show="!description" translate>Add Description</span>
|
||||
<span ng-show="description">{{description}}</span>
|
||||
<i class="icon ion-ios-chatbubble-outline size-21"></i>
|
||||
<i class="icon ion-ios-plus-empty size-21"></i>
|
||||
<span ng-show="!description" translate>Add description</span>
|
||||
<span ng-show="description">{{description}}</span>
|
||||
<i ng-show="!description" class="icon ion-ios-plus-empty size-21"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="item button button-block button-balanced" ng-click="approve()">
|
||||
<button class="item button button-block button-positive" ng-click="approve()">
|
||||
<span translate>Send</span>
|
||||
</button>
|
||||
</ion-content>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<ion-view>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-buttons side="primary">
|
||||
<button class="button back-button" ui-sref="tabs.add">
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
<ion-nav-back-button>
|
||||
<i class="icon ion-ios-arrow-thin-left"></i>
|
||||
</ion-nav-back-button>
|
||||
<ion-nav-title>{{'Join shared wallet' | translate}}</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<ion-modal-view ng-controller="scannerController" ng-init="init()">
|
||||
<ion-header-bar align-title="center" class="bar-royal">
|
||||
<button ng-click="cancel()" class="button button-clear button-positive" translate>
|
||||
<button ng-click="cancel()" class="button button-back button-clear" translate>
|
||||
Close
|
||||
</button>
|
||||
<h1 class="title ellipsis" translate>QR-Scanner</h1>
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@
|
|||
</span>
|
||||
</h2>
|
||||
|
||||
<span class="badge badge-assertive" ng-show="!wallet.isComplete()" translate>
|
||||
<p>
|
||||
<span ng-show="!wallet.isComplete()" class="assertive" translate>
|
||||
Incomplete
|
||||
</span>
|
||||
<p ng-show="wallet.isComplete() && !wallet.balanceHidden">
|
||||
{{wallet.status.availableBalanceStr}}
|
||||
</p>
|
||||
<p ng-show="wallet.isComplete() && wallet.balanceHidden">
|
||||
<strong class="size-12" translate>[Balance Hidden]</strong>
|
||||
<div ng-show="wallet.isComplete()">
|
||||
<span ng-show="!wallet.balanceHidden">{{wallet.status.availableBalanceStr}}</span>
|
||||
<span ng-show="wallet.balanceHidden" translate>[Balance Hidden]</span>
|
||||
</div>
|
||||
</p>
|
||||
<i class="icon nav-item-arrow-right"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ angular.module('copayApp.controllers').controller('addressbookViewController', f
|
|||
});
|
||||
|
||||
$scope.sendTo = function() {
|
||||
$state.go('^.^.send');
|
||||
$timeout(function() {
|
||||
$state.transitionTo('send.amount', {
|
||||
$state.go('.amount', {
|
||||
toAddress: $scope.addressbookEntry.address,
|
||||
toName: $scope.addressbookEntry.name
|
||||
toName: $scope.addressbookEntry.name,
|
||||
toEmail: $scope.addressbookEntry.email
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('amountController', function($rootScope, $scope, $filter, $timeout, $ionicHistory, $ionicScrollDelegate, $ionicNavBarDelegate, gettextCatalog, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, txFormatService) {
|
||||
$ionicNavBarDelegate.title(gettextCatalog.getString('Enter Amount'));
|
||||
$ionicNavBarDelegate.showBackButton(true);
|
||||
|
||||
var unitToSatoshi;
|
||||
var satToUnit;
|
||||
|
|
@ -188,7 +189,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
var _amount = evaluate(format($scope.amount));
|
||||
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
|
||||
|
||||
$state.transitionTo('send.confirm', {
|
||||
$state.transitionTo('tabs.send.confirm', {
|
||||
toAmount: amount * unitToSatoshi,
|
||||
toAddress: $scope.toAddress,
|
||||
toName: $scope.toName,
|
||||
|
|
|
|||
|
|
@ -17,24 +17,14 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
|
||||
$scope.showDescriptionPopup = function() {
|
||||
|
||||
$scope.data = {
|
||||
comment: null
|
||||
var title = gettextCatalog.getString('Add description');
|
||||
var opts = {
|
||||
defaultText: $scope.description
|
||||
};
|
||||
|
||||
var commentPopup = $ionicPopup.show({
|
||||
templateUrl: "views/includes/note.html",
|
||||
title: gettextCatalog.getString('Set description'),
|
||||
scope: $scope,
|
||||
popupService.showPrompt(title, null, opts, function(res) {
|
||||
if (res) $scope.description = res;
|
||||
});
|
||||
$scope.commentPopupClose = function() {
|
||||
commentPopup.close();
|
||||
};
|
||||
$scope.commentPopupSave = function() {
|
||||
$log.debug('Saving description: ' + $scope.data.comment);
|
||||
$scope.description = $scope.data.comment;
|
||||
commentPopup.close();
|
||||
};
|
||||
};
|
||||
|
||||
var setFromPayPro = function(uri, cb) {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
return;
|
||||
}
|
||||
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
|
||||
return $state.transitionTo('send.amount', {
|
||||
return $state.transitionTo('tabs.send.amount', {
|
||||
toAddress: addr,
|
||||
toName: item.name,
|
||||
toEmail: item.email
|
||||
|
|
|
|||
|
|
@ -218,29 +218,24 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Send
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Send
|
||||
*
|
||||
*/
|
||||
|
||||
.state('send', {
|
||||
url: '/send',
|
||||
abstract: true,
|
||||
template: '<ion-nav-view name="send"></ion-nav-view>'
|
||||
})
|
||||
.state('send.amount', {
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:toAddress/:toName/:toEmail',
|
||||
views: {
|
||||
'send': {
|
||||
'tab-send@tabs': {
|
||||
templateUrl: 'views/amount.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('send.confirm', {
|
||||
.state('tabs.send.confirm', {
|
||||
url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
||||
views: {
|
||||
'send': {
|
||||
'tab-send@tabs': {
|
||||
templateUrl: 'views/confirm.html'
|
||||
}
|
||||
}
|
||||
|
|
@ -256,39 +251,39 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
.state('tabs.add', {
|
||||
url: '/add',
|
||||
views: {
|
||||
'tab-home': {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/add.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.join', {
|
||||
.state('tabs.add.join', {
|
||||
url: '/join/:url',
|
||||
views: {
|
||||
'tab-home': {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/join.html'
|
||||
},
|
||||
}
|
||||
})
|
||||
.state('tabs.import', {
|
||||
.state('tabs.add.import', {
|
||||
url: '/import',
|
||||
views: {
|
||||
'tab-home': {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/import.html'
|
||||
},
|
||||
},
|
||||
})
|
||||
.state('tabs.create-personal', {
|
||||
.state('tabs.add.create-personal', {
|
||||
url: '/create-personal',
|
||||
views: {
|
||||
'tab-home': {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/tab-create-personal.html'
|
||||
},
|
||||
}
|
||||
})
|
||||
.state('tabs.create-shared', {
|
||||
.state('tabs.add.create-shared', {
|
||||
url: '/create-shared',
|
||||
views: {
|
||||
'tab-home': {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/tab-create-shared.html'
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
|||
// data extensions for Payment Protocol with non-backwards-compatible request
|
||||
if ((/^bitcoin:\?r=[\w+]/).exec(data)) {
|
||||
data = decodeURIComponent(data.replace('bitcoin:?r=', ''));
|
||||
$state.go('send.confirm', {paypro: data})
|
||||
$state.go('tabs.send.confirm', {paypro: data})
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -42,25 +42,25 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
|||
var amount = parsed.amount ? parsed.amount : '';
|
||||
|
||||
if (parsed.r) {
|
||||
$state.go('send.confirm', {paypro: parsed.r});
|
||||
$state.go('tabs.send.confirm', {paypro: parsed.r});
|
||||
} else {
|
||||
if (amount) {
|
||||
$state.go('send.confirm', {toAmount: amount, toAddress: addr, description:message})
|
||||
$state.go('tabs.send.confirm', {toAmount: amount, toAddress: addr, description:message})
|
||||
} else {
|
||||
$state.go('send.amount', {toAddress: addr})
|
||||
$state.go('tabs.send.amount', {toAddress: addr})
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
// Plain URL
|
||||
} else if (/^https?:\/\//.test(data)) {
|
||||
return $state.go('send.confirm', {paypro: data})
|
||||
return $state.go('tabs.send.confirm', {paypro: data})
|
||||
|
||||
// Plain Address
|
||||
} else if (bitcore.Address.isValid(data, 'livenet')) {
|
||||
return $state.go('send.amount', {toAddress: data})
|
||||
return $state.go('tabs.send.amount', {toAddress: data})
|
||||
} else if (bitcore.Address.isValid(data, 'testnet')) {
|
||||
return $state.go('send.amount', {toAddress: data})
|
||||
return $state.go('tabs.send.amount', {toAddress: data})
|
||||
|
||||
|
||||
// Protocol
|
||||
|
|
@ -71,11 +71,11 @@ angular.module('copayApp.services').factory('incomingData', function($log, $ioni
|
|||
|
||||
// Join
|
||||
} else if (data.match(/^copay:[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
||||
return $state.go('add.join', {url: data})
|
||||
return $state.go('tabs.add.join', {url: data})
|
||||
|
||||
// Old join
|
||||
} else if (data.match(/^[0-9A-HJ-NP-Za-km-z]{70,80}$/)) {
|
||||
return $state.go('add.join', {url: data})
|
||||
return $state.go('tabs.add.join', {url: data})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
|
|||
opts = opts || {};
|
||||
$ionicPopup.prompt({
|
||||
title: title,
|
||||
template: message,
|
||||
inputType: opts.inputType || 'password',
|
||||
inputPlaceholder: opts.inputPlaceholder || 'Your password'
|
||||
subTitle: message,
|
||||
inputType: opts.inputType,
|
||||
inputPlaceholder: opts.inputPlaceholder,
|
||||
defaultText: opts.defaultText
|
||||
}).then(function(res) {
|
||||
return cb(res)
|
||||
});
|
||||
|
|
@ -106,7 +107,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
|
|||
*
|
||||
* @param {String} Title
|
||||
* @param {String} Message
|
||||
* @param {Object} Object{ inputType, inputPlaceholder } (optional)
|
||||
* @param {Object} Object{ inputType, inputPlaceholder, defaultText } (optional)
|
||||
* @param {Callback} Function
|
||||
* @returns {Callback} Return the value of the input if user presses OK
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue