From 41d8a202fa4b7e6b2dd630a38dd5210e9675da36 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 8 Feb 2016 22:25:47 +0100 Subject: [PATCH] Use ngBootbox. --- accountant/frontend/static/js/accounts.js | 6 +++--- accountant/frontend/static/js/app.js | 9 +++++---- accountant/frontend/static/js/operations.js | 6 +++--- accountant/frontend/static/js/scheduler.js | 6 +++--- accountant/frontend/templates/layout.html | 1 + 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/accountant/frontend/static/js/accounts.js b/accountant/frontend/static/js/accounts.js index a814d0d..99c5bf1 100644 --- a/accountant/frontend/static/js/accounts.js +++ b/accountant/frontend/static/js/accounts.js @@ -48,8 +48,8 @@ angular.module('accountant') .controller( 'AccountController', [ - '$scope', 'Account', 'Notification', - function($scope, Account, Notification) { + '$scope', '$ngBootbox', 'Account', 'Notification', + function($scope, $ngBootbox, Account, Notification) { /* * Return the class for an account current value compared to authorized @@ -146,7 +146,7 @@ angular.module('accountant') $scope.delete = function(account, $index) { var id = account.id; - bootbox.confirm( + $ngBootbox.confirm( 'Voulez-vous supprimer le compte \\\'' + account.name + '\\\' ?', function(result) { if(result) { diff --git a/accountant/frontend/static/js/app.js b/accountant/frontend/static/js/app.js index 22f229b..82ac9a2 100644 --- a/accountant/frontend/static/js/app.js +++ b/accountant/frontend/static/js/app.js @@ -24,7 +24,8 @@ angular.module('accountant', [ 'http-auth-interceptor', 'ui-notification', 'Storage.Service', - 'xeditable' + 'xeditable', + 'ngBootbox' ]) .factory('sessionInjector', ['$storage', function($storage) { @@ -103,8 +104,8 @@ angular.module('accountant', [ }) .controller('MainController', [ - '$scope', '$rootScope', '$http', 'authService', '$storage', - function($scope, $rootScope, $http, authService, $storage) { + '$scope', '$rootScope', '$http', 'authService', '$storage', '$ngBootbox', + function($scope, $rootScope, $http, authService, $storage, $ngBootbox) { $scope.dialogShown = false; $scope.showLoginForm = function() { @@ -117,7 +118,7 @@ angular.module('accountant', [ $storage.clear(); - bootbox.dialog({ + $ngBootbox.customDialog({ title: 'Authentification requise', message: '
' + '
' + diff --git a/accountant/frontend/static/js/operations.js b/accountant/frontend/static/js/operations.js index 2a16636..d0f23f9 100644 --- a/accountant/frontend/static/js/operations.js +++ b/accountant/frontend/static/js/operations.js @@ -335,8 +335,8 @@ angular.module('accountant') */ .controller( 'OperationController', [ - '$scope', '$rootScope', '$routeParams', 'Notification', 'Account', 'Operation', - function($scope, $rootScope, $routeParams, Notification, Account, Operation) { + '$scope', '$rootScope', '$routeParams', '$ngBootbox', 'Notification', 'Account', 'Operation', + function($scope, $rootScope, $routeParams, $ngBootbox, Notification, Account, Operation) { // List of operations. $scope.operations = []; @@ -423,7 +423,7 @@ angular.module('accountant') $scope.delete = function(operation, $index) { var id = operation.id; - bootbox.confirm( + $ngBootbox.confirm( 'Voulez-vous supprimer l\'opƩration \\\'' + operation.label + '\\\' ?', function(result) { if(result) { diff --git a/accountant/frontend/static/js/scheduler.js b/accountant/frontend/static/js/scheduler.js index 1eba606..642a84a 100644 --- a/accountant/frontend/static/js/scheduler.js +++ b/accountant/frontend/static/js/scheduler.js @@ -29,8 +29,8 @@ angular.module('accountant') .controller( 'SchedulerController', [ - '$scope', '$rootScope', '$routeParams', 'Notification', 'ScheduledOperation', - function($scope, $rootScope, $routeParams, Notification, ScheduledOperation) { + '$scope', '$rootScope', '$routeParams', '$ngBootbox', 'Notification', 'ScheduledOperation', + function($scope, $rootScope, $routeParams, $ngBootbox, Notification, ScheduledOperation) { // Operation store. $scope.operations = []; @@ -90,7 +90,7 @@ angular.module('accountant') $scope.delete = function(operation, $index) { var id = operation.id; - bootbox.confirm( + $ngBootbox.confirm( 'Voulez-vous supprimer l\'operation planifiƩe \\\'' + operation.label + '\\\' ?', function(result) { if(result) { diff --git a/accountant/frontend/templates/layout.html b/accountant/frontend/templates/layout.html index 8c08088..880a32d 100644 --- a/accountant/frontend/templates/layout.html +++ b/accountant/frontend/templates/layout.html @@ -75,6 +75,7 @@ +