From 3c9041b00ee6ce64ec4ce6fe2b8f81d77c1da108 Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 4 Jun 2017 22:57:49 +0200 Subject: [PATCH 1/3] adds refresh to content type node --- src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs b/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs index 65538778e4..1b4af0f72b 100644 --- a/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentBlueprintTreeController.cs @@ -92,8 +92,12 @@ namespace Umbraco.Web.Trees return menu; } var ct = Services.EntityService.Get(int.Parse(id), UmbracoObjectTypes.DocumentType); - //no menu if it's a content type - if (ct != null) return null; + //only refresh if it's a content type + if (ct != null) + { + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); + return menu; + } menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias))); From f52e82296f043e8e54a6dfb3aa3608cbf0bfbf76 Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 4 Jun 2017 23:35:53 +0200 Subject: [PATCH 2/3] required validation and styling working --- .../content.createblueprint.controller.js | 44 ++++++++++++------- .../src/views/content/createblueprint.html | 30 ++++++++----- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js index f0d6df7724..e9d539b7e8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js @@ -1,24 +1,36 @@ -(function() { +(function () { - function CreateBlueprintController( - $scope, - contentResource, - notificationsService, - navigationService - ) { + function CreateBlueprintController( + $scope, + contentResource, + notificationsService, + navigationService, + localizationService, + formHelper) { $scope.name = $scope.currentNode.name; - $scope.create = function() { - contentResource.createBlueprintFromContent($scope.currentNode.id, $scope.name) - .then(function() { - notificationsService.showNotification({ - type: 3, - header: "Created blueprint", - message: "Blueprint was created based on " + $scope.currentNode.name + localizationService.localize("content_createBlueprintFrom").then(function (value) { + $scope.label = value + " " + $scope.name; + }); + + + $scope.create = function () { + + if (formHelper.submitForm({ scope: $scope, formCtrl: this.blueprintForm, statusMessage: "Creating blueprint..."})) { + + contentResource.createBlueprintFromContent($scope.currentNode.id, $scope.name) + .then(function () { + notificationsService.showNotification({ + type: 3, + header: "Created blueprint", + message: "Blueprint was created based on " + $scope.currentNode.name + }); + navigationService.hideMenu(); }); - navigationService.hideMenu(); - }); + + } + }; } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html index 7fdaf4cd0f..a41d8b82d7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html @@ -1,17 +1,25 @@ 
- From d59e3d34f920e226e61446fe40b243043be4bbd2 Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 4 Jun 2017 23:42:33 +0200 Subject: [PATCH 3/3] fix double submit --- .../src/views/content/createblueprint.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html index 5529d1bfa0..164c7bfd13 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html @@ -19,7 +19,7 @@ -