Use umb-checkbox in the delete doctype confirm (#4982)

This commit is contained in:
Kenn Jacobsen
2019-09-30 19:22:37 +02:00
committed by Sebastiaan Janssen
parent 47f27e8eec
commit e286e60a3b
2 changed files with 10 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
* @description
* The controller for deleting content
*/
function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeResource, treeService, navigationService) {
function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeResource, treeService, navigationService, localizationService) {
$scope.performDelete = function() {
@@ -47,6 +47,13 @@ function DocumentTypesDeleteController($scope, dataTypeResource, contentTypeReso
$scope.cancel = function() {
navigationService.hideDialog();
};
$scope.labels = {};
localizationService
.format(["contentTypeEditor_yesDelete", "contentTypeEditor_andAllDocuments"], "%0% " + $scope.currentNode.name + " %1%")
.then(function (data) {
$scope.labels.deleteConfirm = data;
});
}
angular.module("umbraco").controller("Umbraco.Editors.DocumentTypes.DeleteController", DocumentTypesDeleteController);

View File

@@ -28,10 +28,8 @@
<hr />
<label class="checkbox">
<input type="checkbox" ng-model="confirmed" />
<localize key="contentTypeEditor_yesDelete">Yes, delete</localize> {{currentNode.name}} <localize key="contentTypeEditor_andAllDocuments">and all documents using this type</localize>
</label>
<umb-checkbox model="confirmed" text="{{labels.deleteConfirm}}">
</umb-checkbox>
<umb-confirm ng-if="confirmed" on-confirm="performDelete" on-cancel="cancel">
</umb-confirm>