Change double quotes into single quotes.
This commit is contained in:
parent
ebaf33845a
commit
27fad84f66
@ -19,25 +19,36 @@
|
||||
|
||||
accountantApp
|
||||
|
||||
.factory("Account", ["$resource", function($resource) {
|
||||
.factory('Account', ['$resource', function($resource) {
|
||||
var Account = $resource(
|
||||
"/api/account/:id", {
|
||||
id: "@id"
|
||||
'/api/account/:id', {
|
||||
id: '@id'
|
||||
}
|
||||
);
|
||||
|
||||
Account.prototype.getSolds = function() {
|
||||
var Solds = $resource("/api/account/:id/solds", {id: this.id});
|
||||
var Solds = $resource('/api/account/:id/solds', {id: this.id});
|
||||
|
||||
this.solds = Solds.get();
|
||||
};
|
||||
|
||||
Account.prototype.getBalance = function(begin, end) {
|
||||
var Balance = $resource(
|
||||
'/api/account/:id/balance', {
|
||||
id: this.id,
|
||||
begin: begin.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD')
|
||||
});
|
||||
|
||||
this.balance = Balance.get();
|
||||
};
|
||||
|
||||
return Account;
|
||||
}])
|
||||
|
||||
.controller(
|
||||
"AccountController", [
|
||||
"$scope", "Account", "Notification",
|
||||
'AccountController', [
|
||||
'$scope', 'Account', 'Notification',
|
||||
function($scope, Account, Notification) {
|
||||
|
||||
/*
|
||||
@ -50,9 +61,9 @@ accountantApp
|
||||
}
|
||||
|
||||
if(account.current <account.authorized_overdraft) {
|
||||
return "danger";
|
||||
return 'danger';
|
||||
} else if(account.current < 0) {
|
||||
return "warning";
|
||||
return 'warning';
|
||||
}
|
||||
};
|
||||
|
||||
@ -65,9 +76,9 @@ accountantApp
|
||||
}
|
||||
|
||||
if(value < account.authorized_overdraft) {
|
||||
return "text-danger";
|
||||
return 'text-danger';
|
||||
} else if(value < 0) {
|
||||
return "text-warning";
|
||||
return 'text-warning';
|
||||
}
|
||||
};
|
||||
|
||||
@ -123,7 +134,7 @@ accountantApp
|
||||
return 0;
|
||||
});
|
||||
|
||||
Notification.success("Account #" + data.id + " saved.");
|
||||
Notification.success('Account #' + data.id + ' saved.');
|
||||
|
||||
return data;
|
||||
});
|
||||
@ -136,11 +147,11 @@ accountantApp
|
||||
var id = account.id;
|
||||
|
||||
bootbox.confirm(
|
||||
"Voulez-vous supprimer le compte \"" + account.name + "\" ?",
|
||||
'Voulez-vous supprimer le compte \\\'' + account.name + '\\\' ?',
|
||||
function(result) {
|
||||
if(result) {
|
||||
account.$delete().then(function() {
|
||||
Notification.success("Account #" + id + " deleted.");
|
||||
Notification.success('Account #' + id + ' deleted.');
|
||||
|
||||
// Remove account from array.
|
||||
$scope.accounts.splice($index, 1);
|
||||
|
@ -19,36 +19,36 @@
|
||||
|
||||
accountantApp
|
||||
|
||||
.factory("Operation", [ "$resource", function($resource) {
|
||||
.factory('Operation', [ '$resource', function($resource) {
|
||||
return $resource(
|
||||
"/api/operation/:id", {
|
||||
id: "@id"
|
||||
'/api/operation/:id', {
|
||||
id: '@id'
|
||||
}
|
||||
);
|
||||
}])
|
||||
|
||||
.factory("OHLC", [ "$resource", "$routeParams",
|
||||
.factory('OHLC', [ '$resource', '$routeParams',
|
||||
function($resource, $routeParams) {
|
||||
return $resource(
|
||||
"/api/account/:account_id/ohlc", {
|
||||
'/api/account/:account_id/ohlc', {
|
||||
account_id: $routeParams.accountId
|
||||
}
|
||||
);
|
||||
}])
|
||||
|
||||
.factory("Category", [ "$resource", "$routeParams",
|
||||
.factory('Category', [ '$resource', '$routeParams',
|
||||
function($resource, $routeParams) {
|
||||
return $resource(
|
||||
"/api/account/:account_id/category", {
|
||||
'/api/account/:account_id/category', {
|
||||
account_id: $routeParams.accountId
|
||||
}
|
||||
);
|
||||
}])
|
||||
|
||||
.factory("Balance", [ "$resource", "$routeParams",
|
||||
.factory('Balance', [ '$resource', '$routeParams',
|
||||
function($resource, $routeParams) {
|
||||
return $resource(
|
||||
"/api/account/:account_id/balance", {
|
||||
'/api/account/:account_id/balance', {
|
||||
account_id: $routeParams.accountId
|
||||
}
|
||||
);
|
||||
@ -58,8 +58,8 @@ accountantApp
|
||||
* Controller for category chart.
|
||||
*/
|
||||
.controller(
|
||||
"CategoryChartController", [
|
||||
"$rootScope", "$scope", "$http", "Category", "Balance",
|
||||
'CategoryChartController', [
|
||||
'$rootScope', '$scope', '$http', 'Category', 'Balance',
|
||||
function($rootScope, $scope, $http, Category, Balance) {
|
||||
|
||||
var colors = Highcharts.getOptions().colors;
|
||||
@ -90,14 +90,14 @@ accountantApp
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: "Categories"
|
||||
text: 'Categories'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
text: "Répartition dépenses/recettes"
|
||||
text: 'Répartition dépenses/recettes'
|
||||
},
|
||||
series: [{
|
||||
name: "Value",
|
||||
name: 'Value',
|
||||
data: [],
|
||||
innerSize: '33%',
|
||||
size: '60%',
|
||||
@ -108,7 +108,7 @@ accountantApp
|
||||
distance: -40
|
||||
}
|
||||
}, {
|
||||
name: "Value",
|
||||
name: 'Value',
|
||||
data: [],
|
||||
innerSize: '66%',
|
||||
size: '60%',
|
||||
@ -165,20 +165,20 @@ accountantApp
|
||||
*/
|
||||
$scope.getBalance = function(begin, end) {
|
||||
Balance.get({
|
||||
begin: begin.format("YYYY-MM-DD"),
|
||||
end: end.format("YYYY-MM-DD")
|
||||
begin: begin.format('YYYY-MM-DD'),
|
||||
end: end.format('YYYY-MM-DD')
|
||||
}, function(balance) {
|
||||
// Update pie chart subtitle with Balance.
|
||||
$scope.config.subtitle = {
|
||||
text: "Balance: " + balance.balance
|
||||
text: 'Balance: ' + balance.balance
|
||||
};
|
||||
|
||||
$scope.config.series[0].data = [{
|
||||
name: "Revenues",
|
||||
name: 'Revenues',
|
||||
y: balance.revenues,
|
||||
color: $scope.revenueColor
|
||||
}, {
|
||||
name: "Expenses",
|
||||
name: 'Expenses',
|
||||
y: -balance.expenses,
|
||||
color: $scope.expenseColor,
|
||||
}];
|
||||
@ -186,7 +186,7 @@ accountantApp
|
||||
};
|
||||
|
||||
// Reload categories and account status on range selection.
|
||||
$rootScope.$on("rangeSelectedEvent", function(e, args) {
|
||||
$rootScope.$on('rangeSelectedEvent', function(e, args) {
|
||||
$scope.load(args.begin, args.end);
|
||||
$scope.getBalance(args.begin, args.end);
|
||||
});
|
||||
@ -196,8 +196,8 @@ accountantApp
|
||||
* Controller for the sold chart.
|
||||
*/
|
||||
.controller(
|
||||
"SoldChartController", [
|
||||
"$rootScope", "$scope", "$http", "OHLC",
|
||||
'SoldChartController', [
|
||||
'$rootScope', '$scope', '$http', 'OHLC',
|
||||
function($rootScope, $scope, $http, OHLC) {
|
||||
// Configure chart for operations.
|
||||
$scope.config = {
|
||||
@ -209,22 +209,22 @@ accountantApp
|
||||
buttons: [{
|
||||
type: 'month',
|
||||
count: 1,
|
||||
text: "1m"
|
||||
text: '1m'
|
||||
}, {
|
||||
type: "month",
|
||||
type: 'month',
|
||||
count: 3,
|
||||
text: "3m"
|
||||
text: '3m'
|
||||
}, {
|
||||
type: "month",
|
||||
type: 'month',
|
||||
count: 6,
|
||||
text: "6m"
|
||||
text: '6m'
|
||||
}, {
|
||||
type: "year",
|
||||
type: 'year',
|
||||
count: 1,
|
||||
text: "1y"
|
||||
text: '1y'
|
||||
}, {
|
||||
type: "all",
|
||||
text: "All"
|
||||
type: 'all',
|
||||
text: 'All'
|
||||
}],
|
||||
selected: 0,
|
||||
},
|
||||
@ -242,8 +242,8 @@ accountantApp
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
type: "ohlc",
|
||||
name: "Sold",
|
||||
type: 'ohlc',
|
||||
name: 'Sold',
|
||||
data: [],
|
||||
dataGrouping : {
|
||||
units : [[
|
||||
@ -256,18 +256,18 @@ accountantApp
|
||||
}
|
||||
}],
|
||||
title: {
|
||||
text: "Sold evolution"
|
||||
text: 'Sold evolution'
|
||||
},
|
||||
xAxis: {
|
||||
type: "datetime",
|
||||
type: 'datetime',
|
||||
dateTimeLabelFormats: {
|
||||
month: "%e. %b",
|
||||
year: "%Y"
|
||||
month: '%e. %b',
|
||||
year: '%Y'
|
||||
},
|
||||
minRange: 3600 * 1000 * 24 * 14, // 2 weeks
|
||||
events: {
|
||||
afterSetExtremes: function(e) {
|
||||
$scope.$emit("rangeSelectedEvent", {
|
||||
$scope.$emit('rangeSelectedEvent', {
|
||||
begin: moment.utc(e.min), end: moment.utc(e.max)
|
||||
});
|
||||
}
|
||||
@ -277,11 +277,11 @@ accountantApp
|
||||
},
|
||||
yAxis: {
|
||||
plotLines: [{
|
||||
color: "orange",
|
||||
color: 'orange',
|
||||
width: 2,
|
||||
value: 0.0
|
||||
}, {
|
||||
color: "red",
|
||||
color: 'red',
|
||||
width: 2,
|
||||
value: 0.0
|
||||
}]
|
||||
@ -302,7 +302,7 @@ accountantApp
|
||||
]);
|
||||
});
|
||||
|
||||
$scope.$emit("rangeSelectedEvent", {
|
||||
$scope.$emit('rangeSelectedEvent', {
|
||||
begin: $scope.config.xAxis.currentMin,
|
||||
end: $scope.config.xAxis.currentMax
|
||||
});
|
||||
@ -312,17 +312,17 @@ accountantApp
|
||||
};
|
||||
|
||||
// Reload solds when an operation is saved.
|
||||
$rootScope.$on("operationSavedEvent", function(e, operation) {
|
||||
$rootScope.$on('operationSavedEvent', function(e, operation) {
|
||||
$scope.loadSolds();
|
||||
});
|
||||
|
||||
// Reload solds when an operation is deleted.
|
||||
$rootScope.$on("operationDeletedEvent", function(e, operation) {
|
||||
$rootScope.$on('operationDeletedEvent', function(e, operation) {
|
||||
$scope.loadSolds();
|
||||
});
|
||||
|
||||
// Update authorized overdraft on account loading.
|
||||
$rootScope.$on("accountLoadedEvent", function(e, account) {
|
||||
$rootScope.$on('accountLoadedEvent', function(e, account) {
|
||||
$scope.config.yAxis.plotLines[1].value = account.authorized_overdraft;
|
||||
});
|
||||
|
||||
@ -334,8 +334,8 @@ accountantApp
|
||||
* Controller for the operations.
|
||||
*/
|
||||
.controller(
|
||||
"OperationController", [
|
||||
"$scope", "$rootScope", "$routeParams", "Notification", "Account", "Operation",
|
||||
'OperationController', [
|
||||
'$scope', '$rootScope', '$routeParams', 'Notification', 'Account', 'Operation',
|
||||
function($scope, $rootScope, $routeParams, Notification, Account, Operation) {
|
||||
// List of operations.
|
||||
$scope.operations = [];
|
||||
@ -411,9 +411,9 @@ accountantApp
|
||||
operation.confirmed = true;
|
||||
|
||||
return operation.$save().then(function(data) {
|
||||
Notification.success("Operation #" + data.id + " saved.");
|
||||
Notification.success('Operation #' + data.id + ' saved.');
|
||||
|
||||
$scope.$emit("operationSavedEvent", data);
|
||||
$scope.$emit('operationSavedEvent', data);
|
||||
});
|
||||
};
|
||||
|
||||
@ -424,16 +424,16 @@ accountantApp
|
||||
var id = operation.id;
|
||||
|
||||
bootbox.confirm(
|
||||
"Voulez-vous supprimer l'opération \"" + operation.label + "\" ?",
|
||||
'Voulez-vous supprimer l\'opération \\\'' + operation.label + '\\\' ?',
|
||||
function(result) {
|
||||
if(result) {
|
||||
operation.$delete().then(function() {
|
||||
Notification.success("Operation #" + id + " deleted.");
|
||||
Notification.success('Operation #' + id + ' deleted.');
|
||||
|
||||
// Remove operation from array.
|
||||
$scope.operation.splice($index, 1);
|
||||
|
||||
$scope.$emit("operationDeletedEvent", operation);
|
||||
$scope.$emit('operationDeletedEvent', operation);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -447,7 +447,7 @@ accountantApp
|
||||
/*
|
||||
* Reload operations on rangeSelectedEvent.
|
||||
*/
|
||||
$rootScope.$on("rangeSelectedEvent", function(e, args) {
|
||||
$rootScope.$on('rangeSelectedEvent', function(e, args) {
|
||||
$scope.load(args.begin, args.end);
|
||||
});
|
||||
}]);
|
||||
|
@ -18,17 +18,17 @@
|
||||
|
||||
accountantApp
|
||||
|
||||
.factory("ScheduledOperation", ["$resource", function($resource) {
|
||||
.factory('ScheduledOperation', ['$resource', function($resource) {
|
||||
return $resource(
|
||||
"/api/scheduled_operation/:id", {
|
||||
id: "@id"
|
||||
'/api/scheduled_operation/:id', {
|
||||
id: '@id'
|
||||
}
|
||||
);
|
||||
}])
|
||||
|
||||
.controller(
|
||||
"SchedulerController", [
|
||||
"$scope", "$rootScope", "$routeParams", "Notification", "ScheduledOperation",
|
||||
'SchedulerController', [
|
||||
'$scope', '$rootScope', '$routeParams', 'Notification', 'ScheduledOperation',
|
||||
function($scope, $rootScope, $routeParams, Notification, ScheduledOperation) {
|
||||
// Operation store.
|
||||
$scope.operations = [];
|
||||
@ -68,7 +68,7 @@ accountantApp
|
||||
}
|
||||
|
||||
return operation.$save().then(function(data) {
|
||||
Notification.success("Operation #" + data.id + " saved.");
|
||||
Notification.success('Operation #' + data.id + ' saved.');
|
||||
});
|
||||
};
|
||||
|
||||
@ -90,11 +90,11 @@ accountantApp
|
||||
var id = operation.id;
|
||||
|
||||
bootbox.confirm(
|
||||
"Voulez-vous supprimer l'operation planifiée \"" + operation.label + "\" ?",
|
||||
'Voulez-vous supprimer l\'operation planifiée \\\'' + operation.label + '\\\' ?',
|
||||
function(result) {
|
||||
if(result) {
|
||||
operation.$delete().then(function() {
|
||||
Notification.success("Operation #" + id + " deleted.");
|
||||
Notification.success('Operation #' + id + ' deleted.');
|
||||
|
||||
// Remove account from array.
|
||||
$scope.operations.splice($index, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user