forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add copy dialog for member type * Implement copy action for member type * Create specific localization for content type, media type and member type * Handle "foldersonly" querystring * Add button type attribute * Add a few missing changes of anchor to button element
- Loading branch information
Showing
18 changed files
with
221 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Web.UI.Client/src/views/documenttypes/export.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/Umbraco.Web.UI.Client/src/views/membertypes/copy.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
angular.module("umbraco") | ||
.controller("Umbraco.Editors.MemberTypes.CopyController", | ||
function ($scope, memberTypeResource, treeService, navigationService, notificationsService, appState, eventsService) { | ||
|
||
$scope.dialogTreeApi = {}; | ||
$scope.source = _.clone($scope.currentNode); | ||
|
||
function nodeSelectHandler(args) { | ||
args.event.preventDefault(); | ||
args.event.stopPropagation(); | ||
|
||
if ($scope.target) { | ||
//un-select if there's a current one selected | ||
$scope.target.selected = false; | ||
} | ||
|
||
$scope.target = args.node; | ||
$scope.target.selected = true; | ||
} | ||
|
||
$scope.copy = function () { | ||
|
||
$scope.busy = true; | ||
$scope.error = false; | ||
|
||
memberTypeResource.copy({ parentId: $scope.target.id, id: $scope.source.id }) | ||
.then(function (path) { | ||
$scope.error = false; | ||
$scope.success = true; | ||
$scope.busy = false; | ||
|
||
//get the currently edited node (if any) | ||
var activeNode = appState.getTreeState("selectedNode"); | ||
|
||
//we need to do a double sync here: first sync to the copied content - but don't activate the node, | ||
//then sync to the currenlty edited content (note: this might not be the content that was copied!!) | ||
|
||
navigationService.syncTree({ tree: "memberTypes", path: path, forceReload: true, activate: false }).then(function (args) { | ||
if (activeNode) { | ||
var activeNodePath = treeService.getPath(activeNode).join(); | ||
//sync to this node now - depending on what was copied this might already be synced but might not be | ||
navigationService.syncTree({ tree: "memberTypes", path: activeNodePath, forceReload: false, activate: true }); | ||
} | ||
}); | ||
|
||
}, function (err) { | ||
$scope.success = false; | ||
$scope.error = err; | ||
$scope.busy = false; | ||
}); | ||
}; | ||
|
||
$scope.onTreeInit = function () { | ||
$scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); | ||
}; | ||
|
||
$scope.close = function() { | ||
navigationService.hideDialog(); | ||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<div class="umb-dialog" ng-controller="Umbraco.Editors.MemberTypes.CopyController"> | ||
|
||
<div class="umb-dialog-body"> | ||
<div class="umb-pane"> | ||
|
||
<p class="abstract" ng-hide="success"> | ||
<localize key="contentTypeEditor_folderToCopy">Select the folder to copy</localize> <strong>{{source.name}}</strong> <localize key="contentTypeEditor_structureBelow">to in the tree structure below</localize> | ||
</p> | ||
|
||
<umb-loader ng-show="busy"></umb-loader> | ||
|
||
<div ng-show="error"> | ||
<div class="alert alert-error"> | ||
<div><strong>{{error.errorMsg}}</strong></div> | ||
<div>{{error.data.message}}</div> | ||
</div> | ||
</div> | ||
|
||
<div ng-show="success"> | ||
<div class="alert alert-success"> | ||
<strong>{{source.name}}</strong> <localize key="contentTypeEditor_copiedUnderneath">was copied underneath</localize> <strong>{{target.name}}</strong> | ||
</div> | ||
<button type="button" class="btn btn-primary" ng-click="close()">Ok</button> | ||
</div> | ||
|
||
<div ng-hide="success"> | ||
|
||
<div> | ||
<umb-tree section="settings" | ||
treealias="memberTypes" | ||
customtreeparams="foldersonly=1" | ||
hideheader="false" | ||
hideoptions="true" | ||
isdialog="true" | ||
api="dialogTreeApi" | ||
on-init="onTreeInit()" | ||
enablecheckboxes="true"> | ||
</umb-tree> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success"> | ||
<button type="button" class="btn btn-link" ng-click="close()" ng-show="!busy"> | ||
<localize key="general_cancel">Cancel</localize> | ||
</button> | ||
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy || !target"> | ||
<localize key="actions_copy">Copy</localize> | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters