Merge pull request #804 from rasmusjp/feature/copy-content-dialog

Added recursive option to copy dialog
This commit is contained in:
Shannon Deminick
2015-10-22 10:38:07 +02:00
4 changed files with 16 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController",
searchText = value + "...";
});
$scope.recursive = true;
$scope.relateToOriginal = false;
$scope.dialogTreeEventHandler = $({});
$scope.busy = false;
@@ -95,7 +96,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.CopyController",
$scope.busy = true;
$scope.error = false;
contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal })
contentResource.copy({ parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relateToOriginal, recursive: $scope.recursive })
.then(function (path) {
$scope.error = false;
$scope.success = true;

View File

@@ -56,6 +56,12 @@
</umb-control-group>
</umb-pane>
<umb-pane>
<umb-control-group label="Include descendants">
<input type="checkbox" ng-model="$parent.$parent.recursive" />
</umb-control-group>
</umb-pane>
</div>
</div>
</div>

View File

@@ -491,7 +491,7 @@ namespace Umbraco.Web.Editors
{
var toCopy = ValidateMoveOrCopy(copy);
var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal);
var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive);
var response = Request.CreateResponse(HttpStatusCode.OK);
response.Content = new StringContent(c.Path, Encoding.UTF8, "application/json");

View File

@@ -33,6 +33,13 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "relateToOriginal", IsRequired = true)]
[Required]
public bool RelateToOriginal { get; set; }
/// <summary>
/// Boolean indicating whether copying the object should be recursive
/// </summary>
[DataMember(Name = "recursive", IsRequired = true)]
[Required]
public bool Recursive { get; set; }
}
}