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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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