From 96a102decfe3fe83a95161db0208f68b57a3387e Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Thu, 25 Oct 2018 12:13:54 +0200 Subject: [PATCH 01/12] #3433 fix build error --- src/Umbraco.Core/Services/Implement/ContentService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index 2cd9051e72..200c5af096 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -1994,7 +1994,7 @@ namespace Umbraco.Core.Services.Implement if (raiseEvents && published.Any()) scope.Events.Dispatch(Published, this, new PublishEventArgs(published, false, false), "Published"); - Audit(AuditType.Sort, "Sorting content performed by user", userId, 0); + Audit(AuditType.Sort, userId, 0, "Sorting content performed by user"); return true; } From 5199e8e901619bb4045f1a157c3af8af3772cd0e Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Thu, 25 Oct 2018 12:23:34 +0200 Subject: [PATCH 02/12] #3433 replace checkbox with for setting culture variants with toggle box --- .../views/permissions/permissions.controller.js | 14 ++++++++++++-- .../views/permissions/permissions.html | 10 +++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.controller.js index 028380ff81..4a7a870618 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.controller.js @@ -23,7 +23,8 @@ vm.addChild = addChild; vm.removeChild = removeChild; - vm.toggle = toggle; + vm.toggleAllowAsRoot = toggleAllowAsRoot; + vm.toggleAllowCultureVariants = toggleAllowCultureVariants; /* ---------- INIT ---------- */ @@ -86,7 +87,7 @@ /** * Toggle the $scope.model.allowAsRoot value to either true or false */ - function toggle(){ + function toggleAllowAsRoot(){ if($scope.model.allowAsRoot){ $scope.model.allowAsRoot = false; return; @@ -95,6 +96,15 @@ $scope.model.allowAsRoot = true; } + function toggleAllowCultureVariants() { + if ($scope.model.allowCultureVariant) { + $scope.model.allowCultureVariant = false; + return; + } + + $scope.model.allowCultureVariant = true; + } + } angular.module("umbraco").controller("Umbraco.Editors.DocumentType.PermissionsController", PermissionsController); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html index 2ecd1c518c..956b0d32ed 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html @@ -13,7 +13,7 @@ @@ -48,8 +48,12 @@ Define the rules for how this content type's properties can be varied
-
From 3b2e473a9ebc98285494538bd7fa8b85363c9245 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Thu, 25 Oct 2018 12:38:43 +0200 Subject: [PATCH 03/12] #3433 changed layout so it looks better --- .../views/permissions/permissions.html | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html index 956b0d32ed..79e6c6c3c6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html @@ -10,11 +10,10 @@
- +
@@ -28,24 +27,29 @@
- +
+
+ +
Content Type Variation
+ Define the rules for how this content type's properties can be varied + +
+
-
Content Type Variation
- Define the rules for how this content type's properties can be varied +
- +
- + From 3c217adc2e60fafd2103a55d62420db9eba70931 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Thu, 25 Oct 2018 12:49:32 +0200 Subject: [PATCH 04/12] #3433 added language keys for text of culture variant permissions --- .../views/documenttypes/views/permissions/permissions.html | 6 +++--- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 3 +++ src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html index 79e6c6c3c6..cf7f960cea 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html @@ -41,15 +41,15 @@
-
Content Type Variation
- Define the rules for how this content type's properties can be varied +
+
- +
tab has no sort order Where is this composition used? This composition is currently used in the composition of the following content types: + Content Type Variation + Define the rules for how this content type's properties can be varied + Allow varying by Culture Building models 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 54d86eee5c..b38263d06a 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1505,6 +1505,9 @@ To manage your website, simply open the Umbraco back office and start adding con tab has no sort order Where is this composition used? This composition is currently used in the composition of the following content types: + Content Type Variation + Define the rules for how this content type's properties can be varied + Allow varying by Culture Add language From 2fbe2bb3dad23ac6943889cd4ebb139c53722284 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Thu, 25 Oct 2018 12:54:17 +0200 Subject: [PATCH 05/12] #3433 added short cut for toglle allow culture variants to short cuts overview --- .../src/views/documenttypes/edit.controller.js | 8 +++++++- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 1 + src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js index 10c563a289..ec7a30f9ec 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js @@ -48,7 +48,8 @@ "shortcuts_toggleListView", "shortcuts_toggleAllowAsRoot", "shortcuts_addChildNode", - "shortcuts_addTemplate" + "shortcuts_addTemplate", + "shortcuts_toggleAllowCultureVariants" ]; onInit(); @@ -81,6 +82,7 @@ vm.labels.allowAsRoot = values[11]; vm.labels.addChildNode = values[12]; vm.labels.addTemplate = values[13]; + vm.labels.allowCultureVariants = values[14]; var buttons = [ { @@ -161,6 +163,10 @@ { "description": vm.labels.addChildNode, "keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }] + }, + { + "description": vm.labels.allowCultureVariants, + "keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "v" }] } ] }, diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 9eab99a75a..b9b3d0cfed 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -680,6 +680,7 @@ Move Lines Down General Editor + Toggle allow culture variants Background colour 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 b38263d06a..0265996bbf 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -700,6 +700,7 @@ Move Lines Down General Editor + Toggle allow culture variants Background color From 4cfac8da16ce5e68334f300090563e2bc0739dbd Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 25 Oct 2018 14:54:36 +0200 Subject: [PATCH 06/12] Make it possible to add ellipsis on actions that invokes dialogs by means of OpensDialog on IAction --- src/Umbraco.Tests/Composing/ActionCollectionTests.cs | 4 ++++ .../src/less/components/tree/umb-actions.less | 9 +++++++++ .../views/components/application/umb-contextmenu.html | 4 ++-- src/Umbraco.Web/Models/Trees/MenuItem.cs | 5 +++++ src/Umbraco.Web/_Legacy/Actions/Action.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs | 3 +++ .../_Legacy/Actions/ActionCreateBlueprintFromContent.cs | 1 + src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionExport.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionImport.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionMove.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionNew.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionNull.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionRights.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionSort.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs | 3 +++ src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs | 2 ++ src/Umbraco.Web/_Legacy/Actions/IAction.cs | 4 ++++ .../RelationTypes/TreeMenu/ActionDeleteRelationType.cs | 2 ++ .../RelationTypes/TreeMenu/ActionNewRelationType.cs | 2 ++ 36 files changed, 101 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Tests/Composing/ActionCollectionTests.cs b/src/Umbraco.Tests/Composing/ActionCollectionTests.cs index 04bd0a2e1e..46e4eee765 100644 --- a/src/Umbraco.Tests/Composing/ActionCollectionTests.cs +++ b/src/Umbraco.Tests/Composing/ActionCollectionTests.cs @@ -49,6 +49,8 @@ namespace Umbraco.Tests.Composing public bool ShowInNotifier => false; public bool CanBePermissionAssigned => true; + + public bool OpensDialog => true; } public class NonSingletonAction : IAction @@ -66,6 +68,8 @@ namespace Umbraco.Tests.Composing public bool ShowInNotifier => false; public bool CanBePermissionAssigned => true; + + public bool OpensDialog => true; } #endregion diff --git a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-actions.less b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-actions.less index f52258333d..15296a6aaa 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-actions.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/tree/umb-actions.less @@ -51,6 +51,15 @@ text-decoration: none; } +.umb-action { + &.-opens-dialog { + .menu-label:after { + // adds an ellipsis (...) after the menu label for actions that open a dialog + content: '\2026'; + } + } +} + .umb-actions-child { .umb-action { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-contextmenu.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-contextmenu.html index 32dd57ade3..9d3fa3765d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-contextmenu.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-contextmenu.html @@ -5,7 +5,7 @@ -
\ No newline at end of file +
diff --git a/src/Umbraco.Web/Models/Trees/MenuItem.cs b/src/Umbraco.Web/Models/Trees/MenuItem.cs index 88d772b939..412cd9106d 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItem.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItem.cs @@ -38,6 +38,7 @@ namespace Umbraco.Web.Models.Trees SeperatorBefore = false; Icon = legacyMenu.Icon; Action = legacyMenu; + OpensDialog = legacyMenu.OpensDialog; } #endregion @@ -71,6 +72,10 @@ namespace Umbraco.Web.Models.Trees [DataMember(Name = "cssclass")] public string Icon { get; set; } + + [DataMember(Name = "opensDialog")] + public bool OpensDialog { get; set; } + #endregion #region Constants diff --git a/src/Umbraco.Web/_Legacy/Actions/Action.cs b/src/Umbraco.Web/_Legacy/Actions/Action.cs index 388a5735fd..241218ddb7 100644 --- a/src/Umbraco.Web/_Legacy/Actions/Action.cs +++ b/src/Umbraco.Web/_Legacy/Actions/Action.cs @@ -174,6 +174,7 @@ namespace Umbraco.Web._Legacy.Actions public string Alias { get; set; } public string JsFunctionName { get; set; } public string JsSource { get; set; } + public bool OpensDialog { get; set; } public PlaceboAction() { } public PlaceboAction(IAction legacyAction) @@ -185,6 +186,7 @@ namespace Umbraco.Web._Legacy.Actions Alias = legacyAction.Alias; JsFunctionName = legacyAction.JsFunctionName; JsSource = legacyAction.JsSource; + OpensDialog = legacyAction.OpensDialog; } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs b/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs index 37de1f8e0f..c313f282ad 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs @@ -69,6 +69,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs b/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs index 1425b27917..20dc331516 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs @@ -60,6 +60,8 @@ namespace Umbraco.Web._Legacy.Actions get { return ""; } } + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs b/src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs index 9c31c172ab..b68627c38c 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionChangeDocType.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs b/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs index a489f1d280..5addcec99f 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionCreateBlueprintFromContent.cs b/src/Umbraco.Web/_Legacy/Actions/ActionCreateBlueprintFromContent.cs index e00de39aea..0d028c35b4 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionCreateBlueprintFromContent.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionCreateBlueprintFromContent.cs @@ -20,6 +20,7 @@ namespace Umbraco.Web._Legacy.Actions public string Alias { get; private set; } public string JsFunctionName { get; private set; } public string JsSource { get; private set; } + public bool OpensDialog => true; public ActionCreateBlueprintFromContent() { diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs b/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs index 09ce4d8602..53f7822d47 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs @@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs b/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs index 7f8dd6b03c..f0da5323b9 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs @@ -73,6 +73,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs index df78026ea0..56b98c02f2 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs @@ -71,6 +71,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs b/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs index 42947cf36e..52f163ee6b 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs @@ -72,6 +72,8 @@ } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs b/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs index 80aff5736a..81d1803679 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs index 72e863e38b..ef1b61efc5 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs @@ -70,6 +70,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs index ef281eecbe..fd6bc3d61a 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs @@ -76,6 +76,9 @@ namespace Umbraco.Web._Legacy.Actions return false; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs index 78c5175fb6..3344560c3f 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs @@ -51,6 +51,8 @@ get { return string.Empty; } } + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs index 832e691b48..fa17b87073 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs @@ -75,6 +75,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs index f0ccb03d8e..fdec43e810 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs @@ -75,6 +75,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs b/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs index 357dfe89a4..65e9d7128e 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs index 6b54873c43..70c7735572 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs @@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs index b78af779e4..312ae80825 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs @@ -74,6 +74,9 @@ namespace Umbraco.Web._Legacy.Actions return false; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs index 07133b4030..0abf4fcac5 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs @@ -81,6 +81,9 @@ namespace Umbraco.Web._Legacy.Actions return false; } } + + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs index da70eb1409..2a2baac070 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs @@ -27,6 +27,8 @@ public bool CanBePermissionAssigned => false; + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs index e1ee74e61c..beb3b06ddf 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs index 59044666f7..3179dc9fb5 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs @@ -82,6 +82,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs b/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs index b813dcbc8c..48f6b8d1e9 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs @@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs index ff471bc198..a04a24f4a3 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs @@ -78,6 +78,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs index 0cc5120fd0..157fd827a6 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs @@ -77,6 +77,8 @@ namespace Umbraco.Web._Legacy.Actions } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs index 93d1da2046..cb197342f1 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs @@ -76,6 +76,9 @@ namespace Umbraco.Web._Legacy.Actions return false; } } + + public bool OpensDialog => false; + #endregion } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs index 15458e83ad..5621d505a9 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs @@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions return true; } } + + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs b/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs index 2c66932a04..45a1d0e1c5 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs @@ -46,6 +46,8 @@ get { return false; } } + public bool OpensDialog => false; + #endregion } } diff --git a/src/Umbraco.Web/_Legacy/Actions/IAction.cs b/src/Umbraco.Web/_Legacy/Actions/IAction.cs index 410a407517..48a752e7da 100644 --- a/src/Umbraco.Web/_Legacy/Actions/IAction.cs +++ b/src/Umbraco.Web/_Legacy/Actions/IAction.cs @@ -14,5 +14,9 @@ namespace Umbraco.Web._Legacy.Actions /// A path to a supporting JavaScript file for the IAction. A script tag will be rendered out with the reference to the JavaScript file. /// string JsSource { get; } + /// + /// Whether or not the action opens a dialog when invoked + /// + bool OpensDialog { get; } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs index cf39b17e55..5526a3d9a3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs @@ -78,6 +78,8 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu get { return "javascript:actionDeleteRelationType(UmbClientMgr.mainTree().getActionNode().nodeId,UmbClientMgr.mainTree().getActionNode().nodeName);"; } } + public bool OpensDialog => true; + #endregion } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs index 6018539983..cb776d5246 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs @@ -78,6 +78,8 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu get { return "javascript:actionNewRelationType();"; } } + public bool OpensDialog => true; + #endregion } } From bce2c43fdd26f4f901f365d278f6a424b811e78d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 26 Oct 2018 11:21:56 +0200 Subject: [PATCH 07/12] small fixes to alignment and copy --- .../views/permissions/permissions.html | 14 ++++---------- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 6 +++--- src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml | 6 +++--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html index cf7f960cea..ec1e528f8c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html @@ -39,27 +39,21 @@ -
- -
- - -
-
- +
+
+
-
- +
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index 1acf30a7bd..8bc9d190fa 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -1485,9 +1485,9 @@ To manage your website, simply open the Umbraco back office and start adding con tab has no sort order Where is this composition used? This composition is currently used in the composition of the following content types: - Content Type Variation - Define the rules for how this content type's properties can be varied - Allow varying by Culture + Allow varying by culture + Allow editors to create content of this type in different languages + Allow varying by culture Building models 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 fc6ffa5ca3..a2487b2dc8 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1507,9 +1507,9 @@ To manage your website, simply open the Umbraco back office and start adding con tab has no sort order Where is this composition used? This composition is currently used in the composition of the following content types: - Content Type Variation - Define the rules for how this content type's properties can be varied - Allow varying by Culture + Allow varying by culture + Allow editors to create content of this type in different languages + Allow varying by culture Add language From 0cb19e0dbd04786c805bd2aac010b9328f476ec9 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 26 Oct 2018 11:46:10 +0200 Subject: [PATCH 08/12] Document --- src/Umbraco.Core/Services/IContentService.cs | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs index 64877e393e..7371686c7c 100644 --- a/src/Umbraco.Core/Services/IContentService.cs +++ b/src/Umbraco.Core/Services/IContentService.cs @@ -368,6 +368,11 @@ namespace Umbraco.Core.Services /// A publishing document is a document with values that are being published, i.e. /// that have been published or cleared via and /// . + /// When one needs to publish or unpublish a single culture, or all cultures, using + /// and is the way to go. But if one needs to, say, publish two cultures and unpublish a third + /// one, in one go, then one needs to invoke and + /// on the content itself - this prepares the content, but does not commit anything - and then, invoke + /// to actually commit the changes to the database. /// The document is *always* saved, even when publishing fails. /// PublishResult SavePublishing(IContent content, int userId = 0, bool raiseEvents = true); @@ -375,11 +380,30 @@ namespace Umbraco.Core.Services /// /// Saves and publishes a document branch. /// + /// + /// Unless specified, all cultures are re-published. Otherwise, one culture can be specified. To act on more + /// that one culture, see the other overload of this method. + /// The parameter determines which documents are published. When false, + /// only those documents that are already published, are republished. When true, all documents are + /// published. + /// IEnumerable SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = 0); /// /// Saves and publishes a document branch. /// + /// + /// The parameter determines which documents are published. When false, + /// only those documents that are already published, are republished. When true, all documents are + /// published. + /// The parameter is a function which determines whether a document has + /// values to publish (else there is no need to publish it). If one wants to publish only a selection of + /// cultures, one may want to check that only properties for these cultures have changed. Otherwise, other + /// cultures may trigger an unwanted republish. + /// The parameter is a function to execute to publish cultures, on + /// each document. It can publish all, one, or a selection of cultures. It returns a boolean indicating + /// whether the cultures could be published. + /// IEnumerable SaveAndPublishBranch(IContent content, bool force, Func editing, Func publishCultures, int userId = 0); /// From 45cb56b96c1b0cbbe0adb0a4c0fccc38010761dc Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 26 Oct 2018 12:36:59 +0200 Subject: [PATCH 09/12] Fix ContentCultureInfos and collection --- src/Umbraco.Core/Models/ContentCultureInfos.cs | 10 +++++----- .../Models/ContentCultureInfosCollection.cs | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/Models/ContentCultureInfos.cs b/src/Umbraco.Core/Models/ContentCultureInfos.cs index bcf1dbb1b1..f51e3a275a 100644 --- a/src/Umbraco.Core/Models/ContentCultureInfos.cs +++ b/src/Umbraco.Core/Models/ContentCultureInfos.cs @@ -28,11 +28,11 @@ namespace Umbraco.Core.Models /// Initializes a new instance of the class. /// /// Used for cloning, without change tracking. - private ContentCultureInfos(string culture, string name, DateTime date) - : this(culture) + internal ContentCultureInfos(ContentCultureInfos other) + : this(other.Culture) { - _name = name; - _date = date; + _name = other.Name; + _date = other.Date; } ///
@@ -61,7 +61,7 @@ namespace Umbraco.Core.Models /// public object DeepClone() { - return new ContentCultureInfos(Culture, Name, Date); + return new ContentCultureInfos(this); } /// diff --git a/src/Umbraco.Core/Models/ContentCultureInfosCollection.cs b/src/Umbraco.Core/Models/ContentCultureInfosCollection.cs index 5238e65631..82b0ba6475 100644 --- a/src/Umbraco.Core/Models/ContentCultureInfosCollection.cs +++ b/src/Umbraco.Core/Models/ContentCultureInfosCollection.cs @@ -24,8 +24,12 @@ namespace Umbraco.Core.Models public ContentCultureInfosCollection(IEnumerable items) : base(x => x.Culture, StringComparer.InvariantCultureIgnoreCase) { + // make sure to add *copies* and not the original items, + // as items can be modified by AddOrUpdate, and therefore + // the new collection would be impacted by changes made + // to the old collection foreach (var item in items) - Add(item); + Add(new ContentCultureInfos(item)); } /// From e0365d4214618bdbbc0f8f18477cc903104ba764 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 26 Oct 2018 13:17:12 +0200 Subject: [PATCH 10/12] add ellipsis to action menu items that opens a dialog + fix action menu not opening anything --- .../src/views/components/editor/umb-editor-content-header.html | 2 +- .../src/views/components/editor/umb-editor-menu.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html index 149fccd00a..e0f40a1b3b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html @@ -72,7 +72,7 @@ + current-section="{{menu.currentNode.section}}"> diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-menu.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-menu.html index f724f39be7..bf9c8fab8c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-menu.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-menu.html @@ -8,7 +8,7 @@ From ed4439e3d53a9a84a7582e1141e9383d5aabd7ed Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 26 Oct 2018 13:36:05 +0200 Subject: [PATCH 11/12] add ellipsis to more items --- .../insertcodesnippet/insertcodesnippet.html | 9 ++++----- .../src/views/components/umb-groups-builder.html | 3 ++- .../src/views/datatypes/create.html | 2 +- .../src/views/documenttypes/create.html | 4 ++-- .../src/views/mediatypes/create.html | 2 +- .../src/views/partialviewmacros/create.html | 4 ++-- .../src/views/partialviews/create.html | 4 ++-- src/Umbraco.Web.UI.Client/src/views/scripts/create.html | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html index 58b422ceb2..2ccbf11cc1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/insertcodesnippet/insertcodesnippet.html @@ -16,24 +16,23 @@
-
+
...
-
+
...
-
+
...
-
-
+
...
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html index 2a5bc4a572..1e8c1f74e5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html @@ -13,7 +13,8 @@ label-key="contentTypeEditor_compositions" icon="icon-merge" action="openCompositionsDialog()" - size="xs"> + size="xs" + add-ellipsis="true"> - New folder + New folder... diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html index d19b1329d2..c9f62cd870 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html @@ -25,7 +25,7 @@ - Document Type Collection + Document Type Collection... @@ -33,7 +33,7 @@
  • - + ...
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/create.html b/src/Umbraco.Web.UI.Client/src/views/mediatypes/create.html index ca85bcbf9e..795fd0ba7b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/create.html @@ -16,7 +16,7 @@
  • - + ...
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html index 36ab0e71c1..74a611b3d9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/create.html @@ -25,13 +25,13 @@
  • - >New partial view macro from snippet + >New partial view macro from snippet...
  • - + ...
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html index 59c0b0b344..cfeb2396a7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/create.html @@ -18,13 +18,13 @@
  • - New partial view from snippet + New partial view from snippet...
  • - + ...
  • diff --git a/src/Umbraco.Web.UI.Client/src/views/scripts/create.html b/src/Umbraco.Web.UI.Client/src/views/scripts/create.html index d4c21b4b8a..8b5e0732d2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/scripts/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/scripts/create.html @@ -13,7 +13,7 @@
  • - + ...
  • From 628895cc89c59d66de1cbea95bd59952d03f2408 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 26 Oct 2018 14:38:30 +0200 Subject: [PATCH 12/12] In-Progress in ContentService --- .../Services/Implement/ContentService.cs | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Services/Implement/ContentService.cs b/src/Umbraco.Core/Services/Implement/ContentService.cs index 200c5af096..f14747cda3 100644 --- a/src/Umbraco.Core/Services/Implement/ContentService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentService.cs @@ -1272,12 +1272,49 @@ namespace Umbraco.Core.Services.Implement bool IsEditing(IContent c, string l) => c.PublishName != c.Name || - c.PublishedCultures.Any(x => c.GetCultureName(x) != c.GetPublishName(x)) || - c.Properties.Any(x => x.Values.Where(y => culture == "*" || y.Culture == l).Any(y => !y.EditedValue.Equals(y.PublishedValue))); + c.PublishedCultures.Where(x => x.InvariantEquals(l)).Any(x => c.GetCultureName(x) != c.GetPublishName(x)) || + c.Properties.Any(x => x.Values.Where(y => culture == "*" || y.Culture.InvariantEquals(l)).Any(y => !y.EditedValue.Equals(y.PublishedValue))); return SaveAndPublishBranch(content, force, document => IsEditing(document, culture), document => document.PublishCulture(culture), userId); } + // fixme - make this public once we know it works + document + private IEnumerable SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = 0) + { + // note: EditedValue and PublishedValue are objects here, so it is important to .Equals() + // and not to == them, else we would be comparing references, and that is a bad thing + + cultures = cultures ?? Array.Empty(); + + // determines whether the document is edited, and thus needs to be published, + // for the specified cultures (it may be edited for other cultures and that + // should not trigger a publish). + bool IsEdited(IContent c) + { + if (cultures.Length == 0) + { + // nothing = everything + return c.PublishName != c.Name || + c.PublishedCultures.Any(x => c.GetCultureName(x) != c.GetPublishName(x)) || + c.Properties.Any(x => x.Values.Any(y => !y.EditedValue.Equals(y.PublishedValue))); + } + + return c.PublishName != c.Name || + c.PublishedCultures.Where(x => cultures.Contains(x, StringComparer.InvariantCultureIgnoreCase)).Any(x => c.GetCultureName(x) != c.GetPublishName(x)) || + c.Properties.Any(x => x.Values.Where(y => cultures.Contains(y.Culture, StringComparer.InvariantCultureIgnoreCase)).Any(y => !y.EditedValue.Equals(y.PublishedValue))); + } + + // publish the specified cultures + bool PublishCultures(IContent c) + { + return cultures.Length == 0 + ? c.PublishCulture() // nothing = everything + : cultures.All(c.PublishCulture); + } + + return SaveAndPublishBranch(content, force, IsEdited, PublishCultures, userId); + } + /// public IEnumerable SaveAndPublishBranch(IContent document, bool force, Func editing, Func publishCultures, int userId = 0)