diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebf414065..3278c3c78 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
- Improved notification email to the member when a rolling subscription is taken
- Notify all admins on the creation of a refund invoice
- Calendar management: improved legend display and visual behavior
+- Create machine availabilities: select all/none in a click
- Prevent event reservation in the past [Taiga#127]
- Removed the need of twitter API keys to display the last tweet on the home page
- Handle Ctrl^C in upgrade scripts
diff --git a/app/assets/javascripts/controllers/admin/calendar.js.erb b/app/assets/javascripts/controllers/admin/calendar.js.erb
index 793579bf7..d822d5521 100644
--- a/app/assets/javascripts/controllers/admin/calendar.js.erb
+++ b/app/assets/javascripts/controllers/admin/calendar.js.erb
@@ -416,6 +416,7 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
// machines associated with the created slot
$scope.selectedMachines = [];
+ $scope.selectedMachinesBinding = {};
// training associated with the created slot
$scope.selectedTraining = null;
@@ -475,6 +476,21 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
}
};
+ /**
+ * Select/unselect all the machines
+ */
+ $scope.toggleAll = function() {
+ const count = $scope.selectedMachines.length;
+ $scope.selectedMachines = [];
+ $scope.selectedMachinesBinding = {};
+ if (count == 0) {
+ $scope.machines.forEach(function (machine) {
+ $scope.selectedMachines.push(machine);
+ $scope.selectedMachinesBinding[machine.id] = true;
+ })
+ }
+ }
+
/**
* Callback for the modal window validation: save the slot and closes the modal
*/
diff --git a/app/assets/templates/admin/calendar/eventModal.html.erb b/app/assets/templates/admin/calendar/eventModal.html.erb
index fd526eea3..3b7f245c1 100644
--- a/app/assets/templates/admin/calendar/eventModal.html.erb
+++ b/app/assets/templates/admin/calendar/eventModal.html.erb
@@ -32,8 +32,9 @@