Move, Copy, protect, notifications dialogs polish

This commit is contained in:
perploug
2013-10-02 00:11:10 +02:00
parent 2e8a8e3623
commit 5199a5dc99
16 changed files with 253 additions and 111 deletions

View File

@@ -86,11 +86,11 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
/**
* @ngdoc method
* @name umbraco.resources.contentResource#sort
* @name umbraco.resources.contentResource#move
* @methodOf umbraco.resources.contentResource
*
* @description
* Sorts all children below a given parent node id, based on a collection of node-ids
* Moves a node underneath a new parentId
*
* ##usage
* <pre>
@@ -98,7 +98,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert("node was moved");
* }, function(err){
* alert("node didnt move:" + err);
* alert("node didnt move:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
@@ -127,6 +127,49 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
'Failed to move content');
},
/**
* @ngdoc method
* @name umbraco.resources.contentResource#copy
* @methodOf umbraco.resources.contentResource
*
* @description
* Copies a node underneath a new parentId
*
* ##usage
* <pre>
* contentResource.copy({ parentId: 1244, id: 123 })
* .then(function() {
* alert("node was copied");
* }, function(err){
* alert("node wasnt copy:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.idd the ID of the node to copy
* @param {Int} args.parentId the ID of the parent node to copy to
* @returns {Promise} resourcePromise object.
*
*/
copy: function (args) {
if (!args) {
throw "args cannot be null";
}
if (!args.parentId) {
throw "args.parentId cannot be null";
}
if (!args.id) {
throw "args.id cannot be null";
}
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("contentApiBaseUrl", "PostCopy"),
{
parentId: args.parentId,
id: args.id
}),
'Failed to copy content');
},
/**
* @ngdoc method
* @name umbraco.resources.contentResource#emptyRecycleBin

View File

@@ -16,8 +16,9 @@
.umbracoDialog .umb-dialog-body .umb-pane{margin-left: 20px; margin-right: 20px; margin-top: 20px;}
.umbracoDialog form{height: 100%;}
/*ensures dialogs doesnt have side-by-side labels */
.umbracoDialog .controls-row, .umb-modal .controls-row{margin-left: 0px !important;}
/*ensures dialogs doesnt have side-by-side labels*/
.umbracoDialog .controls-row,
.umb-modal .controls-row{margin-left: 0px !important;}
.controls-row img {
max-width: none;
@@ -84,16 +85,4 @@ iframe, .content-column-body {
.legacy-custom-file{
width: 16px; height: 16px; margin-right: 11px; display: inline-block;
background-position: center center;
}
/* TINYMCE OVERRIDES */
.mce-tinymce{border: 1px solid @grayLight !important; }
.mce-panel{background: @grayLighter !important; border-color: @grayLight !important;}
.mce-btn-group, .mce-btn{border: none !important; background: none !important;}
.mce-ico{font-size: 12px !important; color: @blackLight !important;}
/* Special case to support helviticons for the tiny mce button controls */
.mce-ico.mce-i-custom[class^="icon-"],
.mce-ico.mce-i-custom[class*=" icon-"] {
font-family: icomoon;
font-size:16px !important;
}

View File

@@ -5,7 +5,6 @@
.umb-modalcolumn {
background: white;
border-left: #f6f6f6 1px solid;
white-space: nowrap
}
.umb-modalcolumn-header {
@@ -13,10 +12,12 @@
border-bottom: 1px solid @grayLight;
height: 79px;
padding: 20px 20px 0px 20px;
white-space: nowrap
}
.umb-modalcolumn-header h1{
margin: 0;
white-space: nowrap;
font-size: @fontSizeLarge;
font-weight: 400;
padding-top: 10px !important;
@@ -83,7 +84,7 @@
right: 0px;
bottom: 90px;
}
.umb-dialog-body .umb-pane{margin-top: 0;}
.umb-dialog-body .umb-pane{margin-top: 15px;}
.umb-dialog-footer{
border-top: #efefef 1px solid;

View File

@@ -22,6 +22,21 @@
.umb-contentpicker li a:hover .hover-show{display: inline-block;}
//
// RTE
// --------------------------------------------------
.mce-tinymce{border: 1px solid @grayLight !important; }
.mce-panel{background: @grayLighter !important; border-color: @grayLight !important;}
.mce-btn-group, .mce-btn{border: none !important; background: none !important;}
.mce-ico{font-size: 12px !important; color: @blackLight !important;}
/* Special case to support helviticons for the tiny mce button controls */
.mce-ico.mce-i-custom[class^="icon-"],
.mce-ico.mce-i-custom[class*=" icon-"] {
font-family: icomoon;
font-size:16px !important;
}
//
// Color picker
// --------------------------------------------------

View File

@@ -12,7 +12,6 @@ angular.module("umbraco").controller("Umbraco.Dialogs.ContentPickerController",
if(dialogOptions && dialogOptions.multipicker){
var c = $(args.event.target.parentElement);
if(!args.node.selected){
args.node.selected = true;
c.find("i.umb-tree-icon").hide()
@@ -23,13 +22,6 @@ angular.module("umbraco").controller("Umbraco.Dialogs.ContentPickerController",
c.find("i.umb-tree-icon").show();
}
/*
$(args.event.target.parentElement)
.find("i.umb-tree-icon")
.hide()
.after("class", "icon umb-tree-icon sprTree icon-check blue");
*/
$scope.select(args.node);
}else{

View File

@@ -0,0 +1,38 @@
angular.module("umbraco")
.controller("Umbraco.Editors.Content.CopyController",
function ($scope, eventsService, contentResource, $log) {
var dialogOptions = $scope.$parent.dialogOptions;
$scope.dialogTreeEventHandler = $({});
var node = dialogOptions.currentNode;
$scope.dialogTreeEventHandler.bind("treeNodeSelect", function(ev, args){
args.event.preventDefault();
args.event.stopPropagation();
eventsService.publish("Umbraco.Editors.Content.CopyController.Select", args).then(function(args){
var c = $(args.event.target.parentElement);
if($scope.selectedEl){
$scope.selectedEl.find(".temporary").remove();
$scope.selectedEl.find("i.umb-tree-icon").show();
}
c.find("i.umb-tree-icon").hide()
.after("<i class='icon umb-tree-icon sprTree icon-check blue temporary'></i>");
$scope.target = args.node;
$scope.selectedEl = c;
});
});
$scope.copy = function(){
contentResource.copy({parentId: $scope.target.id, id: node.id})
.then(function(){
$scope.error = false;
$scope.success = true;
},function(err){
$scope.success = false;
$scope.error = err;
});
};
});

View File

@@ -10,15 +10,29 @@ angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController",
args.event.preventDefault();
args.event.stopPropagation();
eventsService.publish("Umbraco.Content.MoveController.Select", args).then(function(args){
contentResource.move({parentId: args.node.id, id:node.id})
.then(function(){
alert("moved");
},function(err){
alert(err);
});
});
eventsService.publish("Umbraco.Editors.Content.MoveController.Select", args).then(function(args){
var c = $(args.event.target.parentElement);
if($scope.selectedEl){
$scope.selectedEl.find(".temporary").remove();
$scope.selectedEl.find("i.umb-tree-icon").show();
}
c.find("i.umb-tree-icon").hide()
.after("<i class='icon umb-tree-icon sprTree icon-check blue temporary'></i>");
$scope.target = args.node;
$scope.selectedEl = c;
});
});
$scope.move = function(){
contentResource.move({parentId: $scope.target.id, id: node.id})
.then(function(){
$scope.error = false;
$scope.success = true;
},function(err){
$scope.success = false;
$scope.error = err;
});
};
});

View File

@@ -1 +1,38 @@
<button ng-click="hideContextDialog()">Cancel</button>
<div ng-controller="Umbraco.Editors.Content.CopyController">
<div class="umb-dialog-body">
<div class="umb-pane">
<p class="abstract" ng-hide="success">
Choose where to copy <strong>{{currentNode.name}}</strong> to in the tree struture below
</p>
<div class="alert alert-error" ng-show="error">
<h4>{{error.errorMsg}}</h4>
<p>{{error.data.Message}}</p>
</div>
<div class="alert alert-success" ng-show="success">
<p><strong>{{currentNode.name}}</strong> was copy underneath
<strong>{{target.name}}</strong></p>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
</div>
<div ng-hide="success">
<umb-tree
section="content"
cachekey="copypickerDialog"
showheader="true"
showoptions="false"
eventhandler="dialogTreeEventHandler">
</umb-tree>
</div>
</div>
</div>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()">Cancel</a>
<button class="btn btn-primary" ng-click="copy()">Copy</button>
</div>
</div>

View File

@@ -1,19 +1,38 @@
<div class="umb-dialog-body" ng-controller="Umbraco.Editors.Content.MoveController">
<div ng-controller="Umbraco.Editors.Content.MoveController">
<div class="umb-dialog-body">
<div class="umb-pane">
<p>Choose where to move {{currentNode.name}} to in the tree struture below</p>
<p class="abstract" ng-hide="success">
Choose where to move <strong>{{currentNode.name}}</strong> to in the tree struture below
</p>
<umb-tree
section="content"
cachekey="movepickerDialog"
showheader="true"
showoptions="false"
eventhandler="dialogTreeEventHandler">
</umb-tree>
<div class="alert alert-error" ng-show="error">
<h4>{{error.errorMsg}}</h4>
<p>{{error.data.Message}}</p>
</div>
<div class="alert alert-success" ng-show="success">
<p><strong>{{currentNode.name}}</strong> was moved underneath
<strong>{{target.name}}</strong></p>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
</div>
<div ng-hide="success">
<umb-tree
section="content"
cachekey="movepickerDialog"
showheader="true"
showoptions="false"
eventhandler="dialogTreeEventHandler">
</umb-tree>
</div>
</div>
</div>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()">Cancel</a>
<button class="btn btn-primary" ng-click="move()">Move</button>
</div>
</div>