Fix indent.

This commit is contained in:
Alexis Lahouze 2017-07-05 21:48:20 +02:00
parent c558994c6d
commit c14d88f421
7 changed files with 918 additions and 914 deletions

View File

@ -35,12 +35,12 @@ var accountModule = angular.module('accountant.accounts', [
ngUiNotification
])
.config(function($resourceProvider) {
.config(function($resourceProvider) {
// Keep trailing slashes to avoid redirect by flask..
$resourceProvider.defaults.stripTrailingSlashes = false;
})
})
.factory('Account', function($resource) {
.factory('Account', function($resource) {
var Account = $resource(
'/api/account/:id', {
id: '@id'
@ -65,9 +65,9 @@ var accountModule = angular.module('accountant.accounts', [
};
return Account;
})
})
.controller('AccountController', function(Account, Notification, $uibModal, $log, $q) {
.controller('AccountController', function(Account, Notification, $uibModal, $log, $q) {
var vm = this;
/*
@ -192,9 +192,9 @@ var accountModule = angular.module('accountant.accounts', [
// Load accounts.
vm.accounts = Account.query();
})
})
.component('accountModifyModalComponent', {
.component('accountModifyModalComponent', {
templateUrl: accountFormTmpl,
bindings: {
resolve: '<',
@ -234,9 +234,9 @@ var accountModule = angular.module('accountant.accounts', [
}
};
}
})
})
.component('accountDeleteModalComponent', {
.component('accountDeleteModalComponent', {
templateUrl: accountDeleteTmpl,
bindings: {
resolve: '<',
@ -271,6 +271,6 @@ var accountModule = angular.module('accountant.accounts', [
}
};
}
});
});
module.exports = accountModule;

View File

@ -41,7 +41,7 @@ var app = angular.module('accountant', [
ngRoute,
])
.config(function($routeProvider) {
.config(function($routeProvider) {
// Defining template and controller in function of route.
$routeProvider
.when('/account/:accountId/operations', {
@ -62,6 +62,6 @@ var app = angular.module('accountant', [
.otherwise({
redirectTo: '/accounts'
});
});
});
module.exports = app;

View File

@ -37,7 +37,7 @@ var loginModule = angular.module('accountant.login', [
ngUiBootstrap
])
.factory('LoginService', function($uibModal, $storage, $document, $log, authService) {
.factory('LoginService', function($uibModal, $storage, $document, $log, authService) {
var login = function () {
$storage.session.clear();
@ -72,9 +72,9 @@ var loginModule = angular.module('accountant.login', [
'login': login,
'cancelLogin': cancelLogin
};
})
})
.factory('sessionInjector', function($storage) {
.factory('sessionInjector', function($storage) {
var sessionInjector = {
request: function(config) {
var access_token = $storage.session.get('access_token');
@ -91,9 +91,9 @@ var loginModule = angular.module('accountant.login', [
};
return sessionInjector;
})
})
.config(function($httpProvider, $storageProvider) {
.config(function($httpProvider, $storageProvider) {
// Define interceptors.
$httpProvider.interceptors.push('sessionInjector');
@ -108,9 +108,9 @@ var loginModule = angular.module('accountant.login', [
// Change the enabled storage engines
// Defaults to ['memory', 'cookie', 'session', 'local']
$storageProvider.setEnabledStorageEngines(['local', 'session']);
})
})
.controller('LoginModalController', function($scope, $uibModalInstance, $http, $log) {
.controller('LoginModalController', function($scope, $uibModalInstance, $http, $log) {
var vm = this;
vm.data = {
@ -143,9 +143,9 @@ var loginModule = angular.module('accountant.login', [
vm.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
})
})
.run(function($rootScope, LoginService) {
.run(function($rootScope, LoginService) {
var onAuthLoginRequired = $rootScope.$on('event:auth-loginRequired', LoginService.login);
var onAuthLoginCancelled = $rootScope.$on('event:auth-loginCancelled', LoginService.cancelLogin);
@ -153,7 +153,6 @@ var loginModule = angular.module('accountant.login', [
$rootScope.$on('$destroy', function() {
onAuthLoginRequired = angular.noop();
});
});
});
module.exports = loginModule;

View File

@ -32,7 +32,7 @@ var balanceChartModule = angular.module('balanceChartModule', [
ngResource
])
.component('balanceChart', {
.component('balanceChart', {
template: '<div></div>',
bindings: {
account: '<',
@ -180,12 +180,14 @@ var balanceChartModule = angular.module('balanceChartModule', [
}
};
}
}).factory('Balances', function($resource) {
})
.factory('Balances', function($resource) {
return $resource(
'/api/account/:id/daily_balances', {
id: '@id'
}
);
});
});
module.exports = balanceChartModule;

View File

@ -29,7 +29,7 @@ var categoryChartModule = angular.module('categoryChartModule', [
ngResource
])
.component('categoryChart', {
.component('categoryChart', {
template: '<div></div>',
bindings: {
minDate: '<',
@ -111,18 +111,22 @@ var categoryChartModule = angular.module('categoryChartModule', [
};
}
}).factory('Categories', function($resource) {
})
.factory('Categories', function($resource) {
return $resource(
'/api/account/:id/category', {
id: '@id'
}
);
}).factory('Incomes', function($resource) {
})
.factory('Incomes', function($resource) {
return $resource(
'/api/account/:id/income', {
id: '@id'
}
);
});
});
module.exports = categoryChartModule;

View File

@ -44,24 +44,24 @@ var operationModule = angular.module('accountant.operations', [
categoryChartModule.name
])
.config(function($resourceProvider) {
.config(function($resourceProvider) {
// Keep trailing slashes to avoid redirect by flask..
$resourceProvider.defaults.stripTrailingSlashes = false;
})
})
.factory('Operation', function($resource) {
.factory('Operation', function($resource) {
return $resource(
'/api/operation/:id', {
id: '@id'
}
);
})
})
/*
/*
* Controller for the operations.
*/
.controller('OperationController', function($routeParams, $uibModal,
Notification, Operation, $log, $q) {
.controller('OperationController', function($routeParams, $uibModal,
Notification, Operation, Account, $log, $q) {
var vm = this;
@ -189,10 +189,10 @@ var operationModule = angular.module('accountant.operations', [
vm.operations = vm.load(minDate, maxDate);
};
//vm.operations = vm.load();
})
vm.account = Account.get({id: $routeParams.accountId});
})
.component('operationModifyModalComponent', {
.component('operationModifyModalComponent', {
templateUrl: operationFormTmpl,
bindings: {
resolve: '<',
@ -227,9 +227,9 @@ var operationModule = angular.module('accountant.operations', [
}
};
}
})
})
.component('operationDeleteModalComponent', {
.component('operationDeleteModalComponent', {
templateUrl: operationDeleteTmpl,
bindings: {
resolve: '<',
@ -264,6 +264,6 @@ var operationModule = angular.module('accountant.operations', [
}
};
}
});
});
module.exports = operationModule;

View File

@ -35,20 +35,20 @@ var schedulerModule = angular.module('accountant.scheduler', [
ngStrap
])
.config(function($resourceProvider) {
.config(function($resourceProvider) {
// Keep trailing slashes to avoid redirect by flask..
$resourceProvider.defaults.stripTrailingSlashes = false;
})
})
.factory('ScheduledOperation', function($resource) {
.factory('ScheduledOperation', function($resource) {
return $resource(
'/api/scheduled_operation/:id', {
id: '@id'
}
);
})
})
.controller('SchedulerController', function($rootScope, $routeParams, Notification, ScheduledOperation, $log, $uibModal, $q) {
.controller('SchedulerController', function($rootScope, $routeParams, Notification, ScheduledOperation, $log, $uibModal, $q) {
var vm = this;
// Operation store.
@ -151,9 +151,9 @@ var schedulerModule = angular.module('accountant.scheduler', [
// Load operations on controller initialization.
vm.operations = vm.load();
})
})
.component('scheduleModifyModalComponent', {
.component('scheduleModifyModalComponent', {
templateUrl: scheduleFormTmpl,
bindings: {
resolve: '<',
@ -188,10 +188,9 @@ var schedulerModule = angular.module('accountant.scheduler', [
}
};
}
})
})
.component('scheduleDeleteModalComponent', {
.component('scheduleDeleteModalComponent', {
templateUrl: scheduleDeleteTmpl,
bindings: {
resolve: '<',
@ -226,6 +225,6 @@ var schedulerModule = angular.module('accountant.scheduler', [
}
};
}
});
});
module.exports = schedulerModule;