ServerVariable for showAllowSegmentationForDocumentTypes

This commit is contained in:
Niels Lyngsø
2020-03-11 13:21:22 +01:00
parent d4dae19888
commit 57e9a9039c
3 changed files with 26 additions and 2 deletions
@@ -20,12 +20,14 @@
vm.selectedChildren = [];
vm.overlayTitle = "";
vm.showAllowSegmentationOption = Umbraco.Sys.ServerVariables.umbracoSettings.showAllowSegmentationForDocumentTypes || false;
vm.addChild = addChild;
vm.removeChild = removeChild;
vm.sortChildren = sortChildren;
vm.toggleAllowAsRoot = toggleAllowAsRoot;
vm.toggleAllowCultureVariants = toggleAllowCultureVariants;
vm.toggleAllowSegmentVariants = toggleAllowSegmentVariants;
vm.canToggleIsElement = false;
vm.toggleIsElement = toggleIsElement;
@@ -110,6 +112,10 @@
$scope.model.allowCultureVariant = $scope.model.allowCultureVariant ? false : true;
}
function toggleAllowSegmentVariants() {
$scope.model.allowSegmentVariant = $scope.model.allowSegmentVariant ? false : true;
}
function toggleIsElement() {
$scope.model.isElement = $scope.model.isElement ? false : true;
}
@@ -43,8 +43,8 @@
<div class="sub-view-columns">
<div class="sub-view-column-left">
<h5><localize key="contentTypeEditor_variantsHeading" /></h5>
<small><localize key="contentTypeEditor_variantsDescription" /></small>
<h5><localize key="contentTypeEditor_cultureVariantHeading" /></h5>
<small><localize key="contentTypeEditor_cultureVariantDescription" /></small>
</div>
<div class="sub-view-column-right">
@@ -57,6 +57,23 @@
</div>
<div class="sub-view-columns" ng-if="vm.showAllowSegmentationOption">
<div class="sub-view-column-left">
<h5><localize key="contentTypeEditor_segmentVariantHeading" /></h5>
<small><localize key="contentTypeEditor_segmentVariantDescription" /></small>
</div>
<div class="sub-view-column-right">
<umb-toggle data-element="permissions-allow-culture-variant"
checked="model.allowSegmentVariant"
on-click="vm.toggleAllowSegmentVariants()">
</umb-toggle>
</div>
</div>
<div class="sub-view-columns">
<div class="sub-view-column-left">
@@ -349,6 +349,7 @@ namespace Umbraco.Web.Editors
{"loginBackgroundImage", Current.Configs.Settings().Content.LoginBackgroundImage},
{"showUserInvite", EmailSender.CanSendRequiredEmail},
{"canSendRequiredEmail", EmailSender.CanSendRequiredEmail},
{"showAllowSegmentationForDocumentTypes", false},
}
},
{