From 505ac5b5c6cc7971d5f003acac02b6ec1b6adaec Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 30 Oct 2014 14:13:40 -0300 Subject: [PATCH] rename controllers and views --- js/controllers/{transactions.js => history.js} | 3 +-- js/controllers/{addresses.js => receive.js} | 4 +--- js/routes.js | 4 ++-- test/unit/controllers/controllersSpec.js | 12 ++++++------ views/{transactions.html => history.html} | 2 +- views/{addresses.html => receive.html} | 4 ++-- 6 files changed, 13 insertions(+), 16 deletions(-) rename js/controllers/{transactions.js => history.js} (95%) rename js/controllers/{addresses.js => receive.js} (95%) rename views/{transactions.html => history.html} (97%) rename views/{addresses.html => receive.html} (96%) diff --git a/js/controllers/transactions.js b/js/controllers/history.js similarity index 95% rename from js/controllers/transactions.js rename to js/controllers/history.js index 019a93616..961f494fa 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/history.js @@ -1,14 +1,13 @@ 'use strict'; var bitcore = require('bitcore'); -angular.module('copayApp.controllers').controller('TransactionsController', +angular.module('copayApp.controllers').controller('HistoryController', function($scope, $rootScope, $timeout, controllerUtils, notification, rateService) { controllerUtils.redirIfNotComplete(); var w = $rootScope.wallet; - $rootScope.title = 'History'; $scope.loading = false; $scope.lastShowed = false; diff --git a/js/controllers/addresses.js b/js/controllers/receive.js similarity index 95% rename from js/controllers/addresses.js rename to js/controllers/receive.js index 3c735212f..c48755481 100644 --- a/js/controllers/addresses.js +++ b/js/controllers/receive.js @@ -1,11 +1,9 @@ 'use strict'; -angular.module('copayApp.controllers').controller('AddressesController', +angular.module('copayApp.controllers').controller('ReceiveController', function($scope, $rootScope, $timeout, $modal, controllerUtils) { controllerUtils.redirIfNotComplete(); - $rootScope.title = 'Addresses'; - $scope.loading = false; $scope.showAll = false; diff --git a/js/routes.js b/js/routes.js index 49473ee04..c3b0cf8ac 100644 --- a/js/routes.js +++ b/js/routes.js @@ -35,11 +35,11 @@ angular logged: true }) .when('/receive', { - templateUrl: 'views/addresses.html', + templateUrl: 'views/receive.html', logged: true }) .when('/history', { - templateUrl: 'views/transactions.html', + templateUrl: 'views/history.html', logged: true }) .when('/send', { diff --git a/test/unit/controllers/controllersSpec.js b/test/unit/controllers/controllersSpec.js index a25175799..5e8df93a5 100644 --- a/test/unit/controllers/controllersSpec.js +++ b/test/unit/controllers/controllersSpec.js @@ -132,25 +132,25 @@ describe("Unit: Controllers", function() { }); - describe('Address Controller', function() { - var addressCtrl; + describe('Receive Controller', function() { + var c; beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); - addressCtrl = $controller('AddressesController', { + c = $controller('ReceiveController', { $scope: scope, }); })); - it('should have a AddressesController controller', function() { + it('should have a ReceiveController controller', function() { expect(scope.loading).equal(false); }); }); - describe('Transactions Controller', function() { + describe('History Controller', function() { var transactionsCtrl; beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); - transactionsCtrl = $controller('TransactionsController', { + transactionsCtrl = $controller('HistoryController', { $scope: scope, }); })); diff --git a/views/transactions.html b/views/history.html similarity index 97% rename from views/transactions.html rename to views/history.html index 817ce39e3..c476da1b2 100644 --- a/views/transactions.html +++ b/views/history.html @@ -1,4 +1,4 @@ -
+

Transaction Proposals ({{txs.length}})

diff --git a/views/addresses.html b/views/receive.html similarity index 96% rename from views/addresses.html rename to views/receive.html index 0883d8df8..391270c2f 100644 --- a/views/addresses.html +++ b/views/receive.html @@ -1,6 +1,6 @@ -
+
-

{{$root.title}}

+

Receive