Content copy with relation in js layer
This commit is contained in:
@@ -145,8 +145,9 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
* });
|
||||
* </pre>
|
||||
* @param {Object} args arguments object
|
||||
* @param {Int} args.idd the ID of the node to copy
|
||||
* @param {Int} args.id the ID of the node to copy
|
||||
* @param {Int} args.parentId the ID of the parent node to copy to
|
||||
* @param {Boolean} args.relateToOriginal if true, relates the copy to the original through the relation api
|
||||
* @returns {Promise} resourcePromise object.
|
||||
*
|
||||
*/
|
||||
@@ -163,10 +164,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostCopy"),
|
||||
{
|
||||
parentId: args.parentId,
|
||||
id: args.id
|
||||
}),
|
||||
args),
|
||||
'Failed to copy content');
|
||||
},
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ angular.module("umbraco")
|
||||
});
|
||||
|
||||
$scope.copy = function(){
|
||||
contentResource.copy({parentId: $scope.target.id, id: node.id})
|
||||
contentResource.copy({parentId: $scope.target.id, id: node.id, relateToOriginal: $scope.relate})
|
||||
.then(function(){
|
||||
$scope.error = false;
|
||||
$scope.success = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div ng-controller="Umbraco.Editors.Content.CopyController">
|
||||
<div class="umb-dialog-body">
|
||||
<div class="umb-dialog-body form-horizontal">
|
||||
<div class="umb-pane">
|
||||
|
||||
<p class="abstract" ng-hide="success">
|
||||
@@ -26,6 +26,13 @@
|
||||
showoptions="false"
|
||||
eventhandler="dialogTreeEventHandler">
|
||||
</umb-tree>
|
||||
|
||||
|
||||
<umb-pane>
|
||||
<umb-control-group label="Relate to original">
|
||||
<input type="checkbox" ng-model="relate" /> </label>
|
||||
</umb-control-group>
|
||||
</umb-pane>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user