diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js index 3833dc50b9..c3093eee9e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js @@ -31,13 +31,15 @@ angular.module("umbraco.directives") return { restrict: 'E', scope:{ - key: '@' + key: '@', + tokens: '=' }, replace: true, link: function (scope, element, attrs) { var key = scope.key; - localizationService.localize(key).then(function(value){ + var tokens = scope.tokens ? scope.tokens : null; + localizationService.localize(key, tokens).then(function(value){ element.html(value); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js index b6fcb8391f..0536863e6b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.controller.js @@ -7,16 +7,53 @@ function onInit() { + vm.includeUnpublished = false; vm.variants = $scope.model.variants; + vm.labels = {}; if (!$scope.model.title) { localizationService.localize("buttons_publishDescendants").then(function (value) { $scope.model.title = value; }); } + + if (vm.variants.length > 1) { + + //now sort it so that the current one is at the top + vm.variants = _.sortBy(vm.variants, function (v) { + return v.active ? 0 : 1; + }); + + var active = _.find(vm.variants, function (v) { + return v.active; + }); + + if (active) { + //ensure that the current one is selected + active.publishDescendants = true; + active.save = true; + } + + } else { + // localize help text for invariant content + vm.labels.help = { + "key": "content_publishDescendantsHelp", + "tokens": [] + }; + // add the node name as a token so it will show up in the translated text + vm.labels.help.tokens.push(vm.variants[0].name); + } } + //when this dialog is closed, reset all 'publish' flags + $scope.$on('$destroy', function () { + for (var i = 0; i < vm.variants.length; i++) { + vm.variants[i].publishDescendants = false; + vm.variants[i].save = false; + } + }); + onInit(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html b/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html index a5b035c82c..ba515c892c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/overlays/publishdescendants.html @@ -1,24 +1,17 @@
-
- Click Publish with descendants to publish {{vm.variants[0].name}} - and all content items underneath and thereby making their content publicly available. +

-
Include drafts
@@ -27,21 +20,16 @@
- Click Publish with descendants to publish the selected languages - and the same languages of all content items underneath and thereby making their content publicly available. +

@@ -55,7 +43,7 @@ diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index f78e25821d..b76bed49cd 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -226,6 +226,8 @@ Published Published (pending changes)> Publication Status + Publish with descendants to publish %0% and all content items underneath and thereby making their content publicly available.]]> + Publish with descendants to publish the selected languages and the same languages of content items underneath and thereby making their content publicly available.]]> Publish at Unpublish at Clear Date @@ -252,6 +254,7 @@ Add another text box Remove this text box Content root + Include drafts: also publish unpublished content items. This value is hidden. If you need access to view this value please contact your website administrator. This value is hidden. What languages would you like to publish? @@ -1148,7 +1151,6 @@ To manage your website, simply open the Umbraco back office and start adding con - Include unpublished subpages Publishing in progress - please wait... %0% out of %1% pages have been published... %0% has been published