Merge pull request #2409 from FinnStutzenstein/Issue2399

Confirm multiple deletions (fixes #2399)
This commit is contained in:
Norman Jäckel 2016-09-21 14:56:19 +02:00 committed by GitHub
commit ed7c9926b5
4 changed files with 12 additions and 9 deletions

View File

@ -186,7 +186,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
} }
}; };
// delete selected items only if items are customslides // delete selected items only if items are customslides
$scope.delete = function () { $scope.deleteMultiple = function () {
angular.forEach($scope.items, function (item) { angular.forEach($scope.items, function (item) {
if (item.selected) { if (item.selected) {
DS.destroy(item.content_object.collection, item.content_object.id); DS.destroy(item.content_object.collection, item.content_object.id);

View File

@ -105,9 +105,10 @@
<div uib-collapse="!isDeleteMode" class="row spacer"> <div uib-collapse="!isDeleteMode" class="row spacer">
<div class="col-sm-12 text-left"> <div class="col-sm-12 text-left">
<!-- delete button --> <!-- delete button -->
<a ng-show="isDeleteMode" <a ng-show="isDeleteMode" os-perms="agenda.can_manage"
os-perms="agenda.can_manage" ng-click="delete()" ng-bootbox-confirm="{{ 'Are you sure you want to delete all selected agenda items?' | translate }}"
class="btn btn-primary"> ng-bootbox-confirm-action="deleteMultiple()"
class="btn btn-primary">
<i class="fa fa-trash fa-lg"></i> <i class="fa fa-trash fa-lg"></i>
<translate>Delete selected items</translate> <translate>Delete selected items</translate>
</a> </a>

View File

@ -61,9 +61,10 @@
<div uib-collapse="!isDeleteMode" class="row spacer"> <div uib-collapse="!isDeleteMode" class="row spacer">
<div class="col-sm-12 text-left"> <div class="col-sm-12 text-left">
<!-- delete button --> <!-- delete button -->
<a ng-show="isDeleteMode" <a ng-show="isDeleteMode" os-perms="assignments.can_manage"
os-perms="assignments.can_manage" ng-click="deleteMultiple()" ng-bootbox-confirm="{{ 'Are you sure you want to delete all selected elections?' | translate }}"
class="btn btn-primary"> ng-bootbox-confirm-action="deleteMultiple()"
class="btn btn-primary">
<i class="fa fa-trash fa-lg"></i> <i class="fa fa-trash fa-lg"></i>
<translate>Delete selected elections</translate> <translate>Delete selected elections</translate>
</a> </a>

View File

@ -92,8 +92,9 @@
</select> </select>
<!-- delete button --> <!-- delete button -->
<a ng-show="selectedAction == 'delete'" <a ng-show="selectedAction == 'delete'"
ng-click="deleteMultiple()" ng-bootbox-confirm="{{ 'Are you sure you want to delete all selected users?' | translate }}"
class="btn btn-default"> ng-bootbox-confirm-action="deleteMultiple()"
class="btn btn-default">
<i class="fa fa-trash fa-lg"></i> <i class="fa fa-trash fa-lg"></i>
<translate>Delete selected participants</translate> <translate>Delete selected participants</translate>
</a> </a>