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 @@

{{ 'app.admin.calendar.select_some_machines' | translate }}

+
diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 23ff5f35c..424ef281b 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -40,6 +40,8 @@ en: next: "Next >" previous: "< Previous" select_some_machines: "Select some machines" + select_all: "All" + select_none: "None" number_of_tickets: "Number of tickets: " adjust_the_opening_hours: "Adjust the opening hours" to_time: "to" # context: time. eg. 'from 18:00 to 21:00' diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml index dd8f24619..aebcf6368 100644 --- a/config/locales/app.admin.es.yml +++ b/config/locales/app.admin.es.yml @@ -40,6 +40,8 @@ es: next: "Siguiente >" previous: "< Anterior" select_some_machines: "Seleccione algunas máquinas" + select_all: "Todas" + select_none: "No" number_of_tickets: "Número de tickets: " adjust_the_opening_hours: "Ajustar el horario de apertura" to_time: "to" # context: hora. ej. 'de 18:00 a 21:00' diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index c117dfa3e..6d49bbc39 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -40,6 +40,8 @@ fr: next: "Suivant >" previous: "< Précédent" select_some_machines: "Sélectionnez des machines" + select_all: "Toutes" + select_none: "Aucune" number_of_tickets: "Nombre de places : " adjust_the_opening_hours: "Ajuster l'horaire" to_time: "à" # context: time. eg. 'from 18:00 to 21:00' diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml index 487a4f7a7..0a9a838ca 100755 --- a/config/locales/app.admin.pt.yml +++ b/config/locales/app.admin.pt.yml @@ -40,6 +40,8 @@ pt: next: "Próximo >" previous: "< Voltar" select_some_machines: "Selecionar algumas máquinas" + select_all: "Tudo" + select_none: "Não" number_of_tickets: "Número de vagas: " adjust_the_opening_hours: "Ajustar o horário de funcionamento" to_time: "ás" # context: time. eg. 'from 18:00 to 21:00'