Merge pull request #1637 from matiaspando/feature/walletHome

Added home for wallet
This commit is contained in:
Gustavo Maximiliano Cortez 2014-10-31 12:08:07 -03:00
commit 653db8f320
6 changed files with 84 additions and 2 deletions

View File

@ -6,7 +6,8 @@ angular.module('copayApp.controllers').controller('CopayersController',
$scope.goToWallet = function() { $scope.goToWallet = function() {
controllerUtils.updateAddressList(); controllerUtils.updateAddressList();
$location.path('/receive'); $location.path('/homeWallet');
}; };
$scope.copayersList = function() { $scope.copayersList = function() {

View File

@ -0,0 +1,17 @@
'use strict';
angular.module('copayApp.controllers').controller('HomeWalletController',
function($scope, $rootScope, $timeout, $modal, controllerUtils) {
controllerUtils.redirIfNotComplete();
$rootScope.title = 'Home';
if ($rootScope.addrInfos) {
$scope.address = $rootScope.addrInfos[0];
console.log('$scope.address', $scope.address);
}
}
);

View File

@ -3,6 +3,10 @@
angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, controllerUtils) { angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, controllerUtils) {
$scope.menu = [{ $scope.menu = [{
'title': 'Home',
'icon': 'fi-home',
'link': 'homeWallet'
}, {
'title': 'Receive', 'title': 'Receive',
'icon': 'fi-download', 'icon': 'fi-download',
'link': 'receive' 'link': 'receive'

View File

@ -34,6 +34,10 @@ angular
templateUrl: 'views/copayers.html', templateUrl: 'views/copayers.html',
logged: true logged: true
}) })
.when('/homeWallet', {
templateUrl: 'views/homeWallet.html',
logged: true
})
.when('/receive', { .when('/receive', {
templateUrl: 'views/receive.html', templateUrl: 'views/receive.html',
logged: true logged: true

View File

@ -24,7 +24,7 @@ angular.module('copayApp.services')
if (!w.isReady()) { if (!w.isReady()) {
$location.path('/copayers'); $location.path('/copayers');
} else { } else {
$location.path('receive'); $location.path('homeWallet');
} }
} }
}; };

56
views/homeWallet.html Normal file
View File

@ -0,0 +1,56 @@
<div class="addresses" ng-controller="HomeWalletController">
<div ng-show='$root.wallet.isReady()'>
<h1 translate class="hide-for-large-up">Home</h1>
<br>
<br>
<!-- Wallet name and balance -->
<div>
<div class="avatar-wallet">{{$root.wallet.getName() | limitTo: 1}}</div>
<div class="ellipsis">{{$root.wallet.getName()}}</div>
<div ng-if="$root.wallet && !$root.updatingBalance" data-options="disable_for_touch:true">
<b class="m5r">{{totalBalance || 0 |noFractionNumber}} {{$root.wallet.settings.unitName}}</b>
<span class="alt-currency">{{totalBalanceAlternative |noFractionNumber:2}} {{alternativeIsoCode}}</span>
</div>
</div>
</div>
<br>
<br>
<!-- Address-->
<span translate>Quick receive</span>
<div>
<qrcode size="220" data="bitcoin:{{address.addressStr}}"></qrcode>
<div class="m10t">
<h4 class="size-12">{{address.addressStr}} <span class="btn-copy" clip-copy="address.addressStr"></span></h4>
<span ng-if="$root.updatingBalance">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</span>
<div class="small-10 columns small-centered">
<button class="m15t button secondary hide-for-large-up" ng-show="isMobile" ng-click="mobileCopy(address.addressStr)">
<i class="fi-link">&nbsp;</i> <span translate>Copy to clipboard</span>
</button>
</div>
</div>
</div>
<br>
<br>
<br>
<!-- List of copayers -->
<div>
<span translate>Copayers</span>
<div ng-include="'views/includes/copayer.html'"></div>
</div>
<!-- <br>
<br>
<br> <!-- Last transactions
<div>
<span translate>Last transactions</span>
</div> -->
</div>