Merge branch 'dev-v7.7' of https://github.com/umbraco/Umbraco-CMS into dev-v7.7

This commit is contained in:
Shannon
2017-08-17 12:18:23 +10:00
5 changed files with 110 additions and 60 deletions

View File

@@ -11,15 +11,19 @@
<umb-editor-container>
<div>
<em><small>TODO: This is a non designed placeholder for beta release - please update me!</small></em>
<h3>What are Content Templates?</h3>
<p>Content Templates are pre-defined content that can be selected when creating a new Content node.</p>
<h3>How do I create a Content Template?</h3>
<p>Simply right-click a content node and select "Create Content Template" to create a new Content Template. Once given a name, editors can start
using the Content Template as a foundation for their new page.</p>
<h3>How do I manage Content Templates</h3>
<p>You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the
<p style="line-height: 1.6em; margin-bottom: 30px;">Content Templates are pre-defined content that can be selected when creating a new content node.</p>
<h4 class="bold">How do I create a Content Template?</h4>
<p style="line-height: 1.6em;">There are two ways to create a Content Template:</p>
<ul style="margin-bottom: 15px;">
<li style="margin-bottom: 5px;">Right-click a content node and select "Create Content Template" to create a new Content Template.</li>
<li>Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.</li>
</ul>
<p style="line-height: 1.6em; margin-bottom: 30px;">Once given a name, editors can start using the Content Template as a foundation for their new page.</p>
<h4 class="bold">How do I manage Content Templates</h4>
<p style="line-height: 1.6em;">You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the
Content Template is based on and click it to edit or delete it.</p>
</div>

View File

@@ -9,6 +9,10 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
$scope.renderModel = [];
$scope.allowRemove = true;
$scope.allowEdit = true;
$scope.sortable = false;
var dialogOptions = {
multiPicker: false,
entityType: "Media",
@@ -49,8 +53,7 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
};
}
$scope.remove =function(index, event){
event.preventDefault();
$scope.remove =function(index){
$scope.renderModel.splice(index, 1);
};
@@ -66,8 +69,17 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
return dialogOptions.idType === "udi" ? i.udi : i.id;
});
if (currIds.indexOf(itemId) < 0) {
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, udi: item.udi });
// store the index of the new item in the renderModel collection so we can find it again
var itemRenderIndex = $scope.renderModel.length - 1;
// get and update the path for the picked node
entityResource.getUrl(item.id, dialogOptions.entityType).then(function(data){
$scope.renderModel[itemRenderIndex].path = data;
});
}
};
@@ -88,13 +100,21 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
if (modelIds.length > 0) {
entityResource.getByIds(modelIds, dialogOptions.entityType).then(function (data) {
_.each(data, function (item, i) {
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, udi: item.udi });
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, udi: item.udi });
// store the index of the new item in the renderModel collection so we can find it again
var itemRenderIndex = $scope.renderModel.length - 1;
// get and update the path for the picked node
entityResource.getUrl(item.id, dialogOptions.entityType).then(function(data){
$scope.renderModel[itemRenderIndex].path = data;
});
});
});
}
}
angular.module('umbraco').controller("Umbraco.PrevalueEditors.MediaPickerController",mediaPickerController);

View File

@@ -1,30 +1,33 @@
<div ng-controller="Umbraco.PrevalueEditors.MediaPickerController" class="umb-editor umb-contentpicker">
<ul class="unstyled list-icons"
ng-model="renderModel">
<li ng-repeat="node in renderModel">
<div ng-model="renderModel">
<umb-node-preview
ng-repeat="node in renderModel"
icon="node.icon"
name="node.name"
published="node.published"
description="node.path"
sortable="sortable"
allow-remove="allowRemove"
allow-edit="allowEdit"
on-remove="remove($index)"
on-edit="openContentPicker()">
</umb-node-preview>
</div>
<a href="" class="hover-show pull-right"><i class="icon icon-delete red" ng-click="remove($index, $event)"></i></a>
<a ng-show="model.config.multiPicker === true || renderModel.length === 0"
class="umb-node-preview-add"
href=""
ng-click="openContentPicker()"
prevent-default>
<localize key="general_add">Add</localize>
</a>
<i class="icon {{node.icon}} hover-hide"></i>
<a href prevent-default ng-click="openContentPicker()" >{{node.name}}</a>
</li>
</ul>
<ul class="unstyled list-icons" ng-show="multipicker || renderModel.length === 0">
<li>
<i class="icon icon-add turquoise"></i>
<a href ng-click="openContentPicker()" prevent-default>
<localize key="general_add">Add</localize>
</a>
</li>
</ul>
<umb-overlay
ng-if="contentPickerOverlay.show"
model="contentPickerOverlay"
position="right"
view="contentPickerOverlay.view">
</umb-overlay>
<umb-overlay
ng-if="contentPickerOverlay.show"
model="contentPickerOverlay"
position="right"
view="contentPickerOverlay.view">
</umb-overlay>
</div>

View File

@@ -7,6 +7,9 @@ angular.module('umbraco')
$scope.renderModel = [];
$scope.ids = [];
$scope.allowRemove = true;
$scope.allowEdit = true;
$scope.sortable = false;
var config = {
multiPicker: false,
@@ -25,8 +28,17 @@ angular.module('umbraco')
$scope.ids = $scope.model.value.split(',');
entityResource.getByIds($scope.ids, config.entityType).then(function (data) {
_.each(data, function (item, i) {
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, udi: item.udi });
$scope.renderModel.push({name: item.name, id: item.id, icon: item.icon, udi: item.udi});
// store the index of the new item in the renderModel collection so we can find it again
var itemRenderIndex = $scope.renderModel.length - 1;
// get and update the path for the picked node
entityResource.getUrl(item.id, config.entityType).then(function(data){
$scope.renderModel[itemRenderIndex].path = data;
});
});
});
}
@@ -55,7 +67,7 @@ angular.module('umbraco')
};
}
$scope.remove =function(index){
$scope.renderModel.splice(index, 1);
$scope.ids.splice(index, 1);
@@ -73,12 +85,20 @@ angular.module('umbraco')
var itemId = config.idType === "udi" ? item.udi : item.id;
if ($scope.ids.indexOf(itemId) < 0){
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.ids.push(itemId);
$scope.ids.push(itemId);
$scope.renderModel.push({name: item.name, id: item.id, icon: item.icon, udi: item.udi});
$scope.model.value = trim($scope.ids.join(), ",");
}
// store the index of the new item in the renderModel collection so we can find it again
var itemRenderIndex = $scope.renderModel.length - 1;
// get and update the path for the picked node
entityResource.getUrl(item.id, config.entityType).then(function(data){
$scope.renderModel[itemRenderIndex].path = data;
});
}
};

View File

@@ -1,24 +1,27 @@
<div ng-controller="Umbraco.PrevalueEditors.TreePickerController" class="umb-editor umb-contentpicker">
<ul class="unstyled list-icons"
ng-model="renderModel">
<li ng-repeat="node in renderModel">
<i class="icon icon-delete red hover-show pull-right" style="cursor:pointer;" ng-click="remove($index); $event.stopPropagation();"></i>
<div ng-model="renderModel">
<umb-node-preview
ng-repeat="node in renderModel"
icon="node.icon"
name="node.name"
published="node.published"
description="node.path"
sortable="sortable"
allow-remove="allowRemove"
allow-edit="allowEdit"
on-remove="remove($index)"
on-edit="openContentPicker()">
</umb-node-preview>
</div>
<i class="icon {{node.icon}} hover-hide"></i>
<a href prevent-default ng-click="openContentPicker()" >{{node.name}}</a>
</li>
</ul>
<ul class="unstyled list-icons" ng-show="multipicker || renderModel.length === 0">
<li>
<i class="icon icon-add turquoise"></i>
<a href ng-click="openContentPicker()" prevent-default>
<localize key="general_add">Add</localize>
</a>
</li>
</ul>
<a ng-show="model.config.multiPicker === true || renderModel.length === 0"
class="umb-node-preview-add"
href=""
ng-click="openContentPicker()"
prevent-default>
<localize key="general_add">Add</localize>
</a>
<umb-overlay
ng-if="treePickerOverlay.show"