From 470e16eaa15a84aaad80f134f779f081e5011d3d Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Fri, 31 Oct 2014 11:49:52 -0300 Subject: [PATCH] Added home --- js/controllers/copayers.js | 3 +- js/controllers/homeWallet.js | 17 +++++++++++ js/controllers/sidebar.js | 4 +++ js/routes.js | 4 +++ js/services/controllerUtils.js | 2 +- views/homeWallet.html | 56 ++++++++++++++++++++++++++++++++++ 6 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 js/controllers/homeWallet.js create mode 100644 views/homeWallet.html diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index fecc482c9..13f202e79 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -6,7 +6,8 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.goToWallet = function() { controllerUtils.updateAddressList(); - $location.path('/receive'); + $location.path('/homeWallet'); + }; $scope.copayersList = function() { diff --git a/js/controllers/homeWallet.js b/js/controllers/homeWallet.js new file mode 100644 index 000000000..23969c6af --- /dev/null +++ b/js/controllers/homeWallet.js @@ -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); + } + + } +); diff --git a/js/controllers/sidebar.js b/js/controllers/sidebar.js index b2f0b26a6..66e2034d0 100644 --- a/js/controllers/sidebar.js +++ b/js/controllers/sidebar.js @@ -3,6 +3,10 @@ angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, controllerUtils) { $scope.menu = [{ + 'title': 'Home', + 'icon': 'fi-home', + 'link': 'homeWallet' + }, { 'title': 'Receive', 'icon': 'fi-download', 'link': 'receive' diff --git a/js/routes.js b/js/routes.js index c3b0cf8ac..9eaaf29f2 100644 --- a/js/routes.js +++ b/js/routes.js @@ -34,6 +34,10 @@ angular templateUrl: 'views/copayers.html', logged: true }) + .when('/homeWallet', { + templateUrl: 'views/homeWallet.html', + logged: true + }) .when('/receive', { templateUrl: 'views/receive.html', logged: true diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 23804b103..c04481eea 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -24,7 +24,7 @@ angular.module('copayApp.services') if (!w.isReady()) { $location.path('/copayers'); } else { - $location.path('receive'); + $location.path('homeWallet'); } } }; diff --git a/views/homeWallet.html b/views/homeWallet.html new file mode 100644 index 000000000..8d9a33590 --- /dev/null +++ b/views/homeWallet.html @@ -0,0 +1,56 @@ +
+
+

Home

+
+
+ + +
+
{{$root.wallet.getName() | limitTo: 1}}
+
{{$root.wallet.getName()}}
+
+ {{totalBalance || 0 |noFractionNumber}} {{$root.wallet.settings.unitName}} + {{totalBalanceAlternative |noFractionNumber:2}} {{alternativeIsoCode}} +
+ +
+
+
+
+ + + Quick receive +
+ + +
+

{{address.addressStr}}

+ + + +
+ +
+
+
+
+
+
+ + +
+ Copayers +
+
+ + + +
+