Update copy on delete dialogs for folders / non-folders

This commit is contained in:
Per Ploug
2015-10-12 11:36:41 +02:00
parent 1ff1f54769
commit aedd7d3268
2 changed files with 45 additions and 12 deletions

View File

@@ -25,6 +25,23 @@ function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeReso
};
$scope.performContainerDelete = function() {
//mark it for deletion (used in the UI)
$scope.currentNode.loading = true;
contentTypeResource.deleteContainerById($scope.currentNode.id).then(function () {
$scope.currentNode.loading = false;
//get the root node before we remove it
var rootNode = treeService.getTreeRoot($scope.currentNode);
//TODO: Need to sync tree, etc...
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
});
};
$scope.cancel = function() {
navigationService.hideDialog();
};

View File

@@ -1,23 +1,39 @@
<div class="umb-dialog umb-pane" ng-controller="Umbraco.Editors.DocumentTypes.DeleteController">
<div class="umb-dialog-body">
<p class="umb-abstract">
Are you absolutely sure you want to delete <strong>{{currentNode.name}}</strong> ?
<p class="umb-abstract">
Are you sure you want to delete <strong>{{currentNode.name}}</strong> ?
</p>
<p>
<i class="icon-alert red"></i> <strong class="red">All Documents</strong>
using this document type will be deleted permanently, please confirm you want to delete these as well.
</p>
<ng-switch on="currentNode.nodeType">
<div ng-switch-when="container">
<p>This action cannot be undone, click ok to delete.</p>
<hr />
<umb-confirm
on-confirm="performContainerDelete"
on-cancel="cancel">
</umb-confirm>
</div>
<label class="checkbox">
<input type="checkbox" ng-model="confirmed" /> Delete {{currentNode.name}} and all documents using this type
</label>
<div ng-switch-default>
<p>
<i class="icon-alert red"></i> <strong class="red">All Documents</strong>
using this document type will be deleted permanently, please confirm you want to delete these as well.
</p>
<hr />
<label class="checkbox">
<input type="checkbox" ng-model="confirmed" />
Yes, delete {{currentNode.name}} and all documents using this type
</label>
<umb-confirm ng-if="confirmed" on-confirm="performDelete" on-cancel="cancel">
</umb-confirm>
</div>
</ng-switch>
<umb-confirm ng-if="confirmed" on-confirm="performDelete" on-cancel="cancel">
</umb-confirm>
</div>
</div>