rename controllers and views

This commit is contained in:
Matias Alejo Garcia 2014-10-30 14:13:40 -03:00
commit 505ac5b5c6
6 changed files with 13 additions and 16 deletions

View file

@ -1,14 +1,13 @@
'use strict'; 'use strict';
var bitcore = require('bitcore'); var bitcore = require('bitcore');
angular.module('copayApp.controllers').controller('TransactionsController', angular.module('copayApp.controllers').controller('HistoryController',
function($scope, $rootScope, $timeout, controllerUtils, notification, rateService) { function($scope, $rootScope, $timeout, controllerUtils, notification, rateService) {
controllerUtils.redirIfNotComplete(); controllerUtils.redirIfNotComplete();
var w = $rootScope.wallet; var w = $rootScope.wallet;
$rootScope.title = 'History';
$scope.loading = false; $scope.loading = false;
$scope.lastShowed = false; $scope.lastShowed = false;

View file

@ -1,11 +1,9 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('AddressesController', angular.module('copayApp.controllers').controller('ReceiveController',
function($scope, $rootScope, $timeout, $modal, controllerUtils) { function($scope, $rootScope, $timeout, $modal, controllerUtils) {
controllerUtils.redirIfNotComplete(); controllerUtils.redirIfNotComplete();
$rootScope.title = 'Addresses';
$scope.loading = false; $scope.loading = false;
$scope.showAll = false; $scope.showAll = false;

View file

@ -35,11 +35,11 @@ angular
logged: true logged: true
}) })
.when('/receive', { .when('/receive', {
templateUrl: 'views/addresses.html', templateUrl: 'views/receive.html',
logged: true logged: true
}) })
.when('/history', { .when('/history', {
templateUrl: 'views/transactions.html', templateUrl: 'views/history.html',
logged: true logged: true
}) })
.when('/send', { .when('/send', {

View file

@ -132,25 +132,25 @@ describe("Unit: Controllers", function() {
}); });
describe('Address Controller', function() { describe('Receive Controller', function() {
var addressCtrl; var c;
beforeEach(inject(function($controller, $rootScope) { beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new(); scope = $rootScope.$new();
addressCtrl = $controller('AddressesController', { c = $controller('ReceiveController', {
$scope: scope, $scope: scope,
}); });
})); }));
it('should have a AddressesController controller', function() { it('should have a ReceiveController controller', function() {
expect(scope.loading).equal(false); expect(scope.loading).equal(false);
}); });
}); });
describe('Transactions Controller', function() { describe('History Controller', function() {
var transactionsCtrl; var transactionsCtrl;
beforeEach(inject(function($controller, $rootScope) { beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new(); scope = $rootScope.$new();
transactionsCtrl = $controller('TransactionsController', { transactionsCtrl = $controller('HistoryController', {
$scope: scope, $scope: scope,
}); });
})); }));

View file

@ -1,4 +1,4 @@
<div class="transactions" data-ng-controller="TransactionsController" data-ng-init="update()"> <div class="transactions" data-ng-controller="HistoryController" data-ng-init="update()">
<div ng-show='$root.wallet.isReady()'> <div ng-show='$root.wallet.isReady()'>
<h2 ng-show="wallet.isShared()"> <h2 ng-show="wallet.isShared()">
<span translate>Transaction Proposals</span> <small>({{txs.length}})</small></h2> <span translate>Transaction Proposals</span> <small>({{txs.length}})</small></h2>

View file

@ -1,6 +1,6 @@
<div class="addresses" ng-controller="AddressesController"> <div class="addresses" ng-controller="ReceiveController">
<div ng-show='$root.wallet.isReady()'> <div ng-show='$root.wallet.isReady()'>
<h1 class="hide-for-large-up">{{$root.title}}</h1> <h1 translate class="hide-for-large-up">Receive</h1>
<div ng-show="!addresses[0]"> <div ng-show="!addresses[0]">
<i class="fi-bitcoin-circle icon-rotate spinner"></i> <i class="fi-bitcoin-circle icon-rotate spinner"></i>
</div> </div>