From 5b00265394db8144ca224e01041c34110ee05138 Mon Sep 17 00:00:00 2001 From: Zsolt Date: Fri, 4 Aug 2017 14:38:37 +0200 Subject: [PATCH 1/5] Change content start node picker --- .../prevalueeditors/treepicker.controller.js | 20 +++++++++---- .../src/views/prevalueeditors/treepicker.html | 30 ++++++++++++++++++- 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js index cf81d1cda6..be9a24fbb7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js @@ -3,7 +3,7 @@ angular.module('umbraco') .controller("Umbraco.PrevalueEditors.TreePickerController", - function($scope, dialogService, entityResource, $log, iconHelper){ + function($scope, dialogService, entityResource, $log, iconHelper, miniEditorHelper){ $scope.renderModel = []; $scope.ids = []; @@ -45,6 +45,11 @@ angular.module('umbraco') populate(model.selection[0]); } + console.log(model); + /* entityResource.getUrl(updatedNode.id, entityType).then(function(data){ + node.url = data; + }); */ + $scope.treePickerOverlay.show = false; $scope.treePickerOverlay = null; }; @@ -55,7 +60,10 @@ angular.module('umbraco') }; } + + + $scope.remove =function(index){ $scope.renderModel.splice(index, 1); $scope.ids.splice(index, 1); @@ -74,10 +82,12 @@ angular.module('umbraco') if ($scope.ids.indexOf(itemId) < 0){ item.icon = iconHelper.convertFromLegacyIcon(item.icon); - - $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(), ","); + entityResource.getUrl(item.id, "Document").then(function(data){ + item.path = data; + $scope.ids.push(itemId); + $scope.renderModel.push({name: item.name, path: item.path, id: item.id, icon: item.icon, udi: item.udi}); + $scope.model.value = trim($scope.ids.join(), ","); + }); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html index 5ec114fc19..dd527bbbbf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html @@ -1,5 +1,5 @@
- + +
+ + +
+ + + + + Add + Date: Mon, 14 Aug 2017 13:08:01 +0200 Subject: [PATCH 2/5] In cms I changed the media picker to the new layout + deleting previously commented code --- .../prevalueeditors/mediapicker.controller.js | 10 ++-- .../views/prevalueeditors/mediapicker.html | 53 ++++++++++--------- .../src/views/prevalueeditors/treepicker.html | 23 -------- 3 files changed, 35 insertions(+), 51 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js index e5c09f420e..e5f582ad12 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js @@ -49,8 +49,7 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon }; } - $scope.remove =function(index, event){ - event.preventDefault(); + $scope.remove =function(index){ $scope.renderModel.splice(index, 1); }; @@ -67,7 +66,10 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon }); 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 }); + entityResource.getUrl(item.id, "Media").then(function(data){ + item.path = data; + $scope.renderModel.push({ name: item.name, id: item.id, path: item.path, icon: item.icon, udi: item.udi }); + }); } }; @@ -89,7 +91,7 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon 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, path: item.path, icon: item.icon, udi: item.udi }); }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html index a902385956..44987b3c9e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html @@ -1,30 +1,35 @@
- - - - - - + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html index dd527bbbbf..0e2ace570e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html @@ -1,16 +1,4 @@
-
- - Date: Tue, 15 Aug 2017 14:41:04 +0200 Subject: [PATCH 3/5] Clean-up with Mads --- .../prevalueeditors/mediapicker.controller.js | 15 +++++++++++---- .../src/views/prevalueeditors/mediapicker.html | 10 ++++------ .../prevalueeditors/treepicker.controller.js | 15 ++++++++------- .../src/views/prevalueeditors/treepicker.html | 10 ++++------ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js index e5f582ad12..a4dda97fe1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js @@ -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", @@ -90,13 +94,16 @@ 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, path: item.path, icon: item.icon, udi: item.udi }); + + entityResource.getUrl(item.id, "Media").then(function(data){ + item.path = data; + item.icon = iconHelper.convertFromLegacyIcon(item.icon); + $scope.renderModel.push({ name: item.name, id: item.id, path: item.path, icon: item.icon, udi: item.udi }); + }); }); }); } - - + } angular.module('umbraco').controller("Umbraco.PrevalueEditors.MediaPickerController",mediaPickerController); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html index 44987b3c9e..f8d780d3e2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.html @@ -1,18 +1,16 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js index be9a24fbb7..8e0c68f1c1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js @@ -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,11 @@ 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 }); + entityResource.getUrl(item.id, "Document").then(function(data){ + item.path = data; + item.icon = iconHelper.convertFromLegacyIcon(item.icon); + $scope.renderModel.push({name: item.name, path: item.path, id: item.id, icon: item.icon, udi: item.udi}); + }); }); }); } @@ -45,11 +51,6 @@ angular.module('umbraco') populate(model.selection[0]); } - console.log(model); - /* entityResource.getUrl(updatedNode.id, entityType).then(function(data){ - node.url = data; - }); */ - $scope.treePickerOverlay.show = false; $scope.treePickerOverlay = null; }; diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html index 0e2ace570e..0ac971caad 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.html @@ -1,18 +1,16 @@
-
+
From 26e590a260074874be990250106cb660f8c0e22f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 16 Aug 2017 09:25:22 +0200 Subject: [PATCH 4/5] don't wait for node path to return before we show the picked node in the UI --- .../prevalueeditors/mediapicker.controller.js | 27 ++++++++---- .../prevalueeditors/treepicker.controller.js | 41 +++++++++++-------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js index a4dda97fe1..95b2c64a6f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/mediapicker.controller.js @@ -69,11 +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); - entityResource.getUrl(item.id, "Media").then(function(data){ - item.path = data; - $scope.renderModel.push({ name: item.name, id: item.id, path: item.path, 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; }); + } }; @@ -95,11 +101,16 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon entityResource.getByIds(modelIds, dialogOptions.entityType).then(function (data) { _.each(data, function (item, i) { - entityResource.getUrl(item.id, "Media").then(function(data){ - item.path = data; - item.icon = iconHelper.convertFromLegacyIcon(item.icon); - $scope.renderModel.push({ name: item.name, id: item.id, path: item.path, icon: item.icon, udi: item.udi }); - }); + 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; + }); + }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js index 8e0c68f1c1..c5746ec149 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/treepicker.controller.js @@ -3,7 +3,7 @@ angular.module('umbraco') .controller("Umbraco.PrevalueEditors.TreePickerController", - function($scope, dialogService, entityResource, $log, iconHelper, miniEditorHelper){ + function($scope, dialogService, entityResource, $log, iconHelper){ $scope.renderModel = []; $scope.ids = []; @@ -28,11 +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) { - entityResource.getUrl(item.id, "Document").then(function(data){ - item.path = data; - item.icon = iconHelper.convertFromLegacyIcon(item.icon); - $scope.renderModel.push({name: item.name, path: item.path, id: item.id, icon: item.icon, udi: item.udi}); - }); + + 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, config.entityType).then(function(data){ + $scope.renderModel[itemRenderIndex].path = data; + }); + }); }); } @@ -62,9 +68,6 @@ angular.module('umbraco') } - - - $scope.remove =function(index){ $scope.renderModel.splice(index, 1); $scope.ids.splice(index, 1); @@ -82,14 +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); - entityResource.getUrl(item.id, "Document").then(function(data){ - item.path = data; - $scope.ids.push(itemId); - $scope.renderModel.push({name: item.name, path: item.path, id: item.id, icon: item.icon, udi: item.udi}); - $scope.model.value = trim($scope.ids.join(), ","); - }); - } + $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; + }); + + } }; From b5acd5388972237db3883c4bd6649b1e5839ff6d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 16 Aug 2017 13:59:35 +0200 Subject: [PATCH 5/5] Add a bit of text formatting to the content templates intro text + describe how to add content templates from the settings section --- .../src/views/contentblueprints/intro.html | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html index 06d17350ff..e7200feba4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html +++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html @@ -11,15 +11,19 @@
- TODO: This is a non designed placeholder for beta release - please update me! -

What are Content Templates?

-

Content Templates are pre-defined content that can be selected when creating a new Content node.

-

How do I create a Content Template?

-

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.

-

How do I manage Content Templates

-

You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the +

Content Templates are pre-defined content that can be selected when creating a new content node.

+ +

How do I create a Content Template?

+

There are two ways to create a Content Template:

+
    +
  • Right-click a content node and select "Create Content Template" to create a new Content Template.
  • +
  • Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.
  • +
+

Once given a name, editors can start using the Content Template as a foundation for their new page.

+ +

How do I manage Content Templates

+

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.