Added move functionality to bulk actions - something is wrong in error handling

This commit is contained in:
Mads Rasmussen
2015-10-20 13:33:45 +02:00
parent 759d8fad5f
commit 20d676e667
2 changed files with 53 additions and 1 deletions

View File

@@ -70,7 +70,8 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
],
allowBulkPublish: true,
allowBulkUnpublish: true,
allowBulkDelete: true,
allowBulkMove: true,
allowBulkDelete: true,
};
// set active layout
@@ -379,6 +380,38 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
function (total) { return "Unpublished " + total + " document" + (total > 1 ? "s" : "") });
};
$scope.move = function() {
$scope.moveDialog = {};
$scope.moveDialog.title = "Move";
$scope.moveDialog.section = $scope.entityType;
$scope.moveDialog.view = "treepicker";
$scope.moveDialog.show = true;
$scope.moveDialog.submit = function(model) {
if(model.selection.length > 0) {
performMove(model.selection[0]);
}
$scope.moveDialog.show = false;
$scope.moveDialog = null;
};
$scope.moveDialog.close = function(oldModel) {
$scope.moveDialog.show = false;
$scope.moveDialog = null;
};
};
function performMove(target) {
applySelected(
function(selected, index) {return contentResource.move({parentId: target.id, id: getIdCallback(selected[index])}); },
function(count, total) {return "Moved " + count + " out of " + total + " document" + (total > 1 ? "s" : ""); },
function(total) {return "Moved " + total + " document" + (total > 1 ? "s" : ""); });
}
function getCustomPropertyValue(alias, properties) {
var value = '';
var index = 0;

View File

@@ -91,6 +91,17 @@
disabled="actionInProgress">
</umb-button>
<umb-button
ng-if="options.allowBulkMove"
type="button"
button-style="link"
label="Move"
key="actions_move"
icon="icon-enter"
action="move()"
disabled="actionInProgress">
</umb-button>
<umb-button
ng-if="options.allowBulkDelete"
type="button"
@@ -139,4 +150,12 @@
</div>
</div>
<umb-overlay
ng-if="moveDialog.show"
model="moveDialog"
position="right"
view="moveDialog.view">
</umb-overlay>
</div>