Merge remote-tracking branch 'origin/temp8' into temp8-231-send-to-publish-with-variants

# Conflicts:
#	src/Umbraco.Core/Services/Implement/ContentService.cs
This commit is contained in:
Shannon
2018-11-01 13:37:18 +11:00
91 changed files with 1505 additions and 462 deletions

View File

@@ -194,7 +194,9 @@
return a.alias === "umbContent";
});
contentApp.viewModel = _.omit(variant, 'apps');
//The view model for the content app is simply the index of the variant being edited
var variantIndex = vm.content.variants.indexOf(variant);
contentApp.viewModel = variantIndex;
// make sure the same app it set to active in the new variant
if(activeAppAlias) {

View File

@@ -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 {

View File

@@ -16,24 +16,23 @@
<umb-box-content>
<div class="umb-insert-code-boxes">
<div ng-if="model.allowedTypes.umbracoField" class="umb-insert-code-box" ng-click="vm.openPageFieldOverlay()">
<div class="umb-insert-code-box__title"><localize key="template_insertPageField" /></div>
<div class="umb-insert-code-box__title"><localize key="template_insertPageField" />...</div>
<div class="umb-insert-code-box__description"><localize key="template_insertPageFieldDesc" /></div>
</div>
<div ng-if="model.allowedTypes.partial" class="umb-insert-code-box" ng-click="vm.openPartialOverlay()">
<div class="umb-insert-code-box__title"><localize key="template_insertPartialView" /></div>
<div class="umb-insert-code-box__title"><localize key="template_insertPartialView" />...</div>
<div class="umb-insert-code-box__description">
<localize key="template_insertPartialViewDesc" />
</div>
</div>
<div ng-if="model.allowedTypes.macro" class="umb-insert-code-box" ng-click="vm.openMacroPicker()">
<div class="umb-insert-code-box__title"><localize key="template_insertMacro" /></div>
<div class="umb-insert-code-box__title"><localize key="template_insertMacro" />...</div>
<div class="umb-insert-code-box__description">
<localize key="template_insertMacroDesc" />
</div>
</div>
<div ng-if="model.allowedTypes.dictionary" class="umb-insert-code-box" ng-click="vm.openDictionaryItemOverlay()">
<div class="umb-insert-code-box__title"><localize key="template_insertDictionaryItem" /></div>
<div class="umb-insert-code-box__title"><localize key="template_insertDictionaryItem" />...</div>
<div class="umb-insert-code-box__description"><localize key="template_insertDictionaryItemDesc" /></div>
</div>
</div>

View File

@@ -376,7 +376,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
var foundIndex = 0;
if ($scope.model.selection.length > 0) {
for (i = 0; $scope.model.selection.length > i; i++) {
for (var i = 0; $scope.model.selection.length > i; i++) {
var selectedItem = $scope.model.selection[i];
if (selectedItem.id === item.id) {
found = true;

View File

@@ -285,7 +285,7 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
var foundIndex = 0;
if ($scope.model.selection.length > 0) {
for (i = 0; $scope.model.selection.length > i; i++) {
for (var i = 0; $scope.model.selection.length > i; i++) {
var selectedItem = $scope.model.selection[i];
if (selectedItem.id === item.id) {
found = true;

View File

@@ -5,7 +5,7 @@
<div class='umb-modalcolumn-body'>
<ul class="umb-actions">
<li data-element="action-{{action.alias}}" ng-click="executeMenuItem(action)" class="umb-action" ng-class="{sep:action.seperator}" ng-repeat="action in menuActions">
<li data-element="action-{{action.alias}}" ng-click="executeMenuItem(action)" class="umb-action" ng-class="{sep:action.seperator, '-opens-dialog': action.opensDialog}" ng-repeat="action in menuActions">
<a class="umb-action-link" prevent-default>
<i class="icon icon-{{action.cssclass}}"></i>
<span class="menu-label">{{action.name}}</span>
@@ -13,4 +13,4 @@
</li>
</ul>
</div>
</div>
</div>

View File

@@ -72,7 +72,7 @@
<umb-editor-menu
data-element="editor-actions"
current-node="menu.currentNode"
current-section="{{menu.currentSection}}">
current-section="{{menu.currentNode.section}}">
</umb-editor-menu>
</div>

View File

@@ -8,7 +8,7 @@
<!-- actions -->
<ul class="dropdown-menu umb-actions" role="menu" aria-labelledby="dLabel">
<li class="umb-action" ng-class="{sep:action.seperator}" ng-repeat="action in actions">
<li class="umb-action" ng-class="{'sep':action.seperatorm, '-opens-dialog': action.opensDialog}" ng-repeat="action in actions">
<!-- How does this reference executeMenuItem() i really don't think that this is very clear -->
<a prevent-default
@@ -17,7 +17,6 @@
<i class="icon icon-{{action.cssclass}}"></i>
<span class="menu-label">{{action.name}}</span>
</a>
</li>
</ul>
</div>

View File

@@ -13,7 +13,8 @@
label-key="contentTypeEditor_compositions"
icon="icon-merge"
action="openCompositionsDialog()"
size="xs">
size="xs"
add-ellipsis="true">
</umb-button>
<umb-button

View File

@@ -3,33 +3,39 @@
function ContentAppContentController($scope, $timeout, serverValidationManager) {
//the contentApp's viewModel is actually the index of the variant being edited, not the variant itself.
//if we make the viewModel the variant itself, we end up with a circular reference in the models which isn't ideal
// (i.e. variant.apps[contentApp].viewModel = variant)
//so instead since we already have access to the content, we can just get the variant directly by the index.
var vm = this;
vm.loading = true;
function onInit() {
vm.content = $scope.model.viewModel;
//get the variant by index (see notes above)
vm.content = $scope.content.variants[$scope.model.viewModel];
serverValidationManager.notify();
vm.loading = false;
//if this variant has a culture/language assigned, then we need to watch it since it will change
//if the language drop down changes and we need to re-init
if (vm.content.language) {
$scope.$watch(function () {
return vm.content.language.culture;
}, function (newVal, oldVal) {
if (newVal !== oldVal) {
vm.loading = true;
//TODO: Can we minimize the flicker?
$timeout(function () {
onInit();
}, 100);
}
});
}
}
onInit();
//if this variant has a culture/language assigned, then we need to watch it since it will change
//if the language drop down changes and we need to re-init
if ($scope.model.viewModel.language) {
$scope.$watch(function () {
return $scope.model.viewModel.language.culture;
}, function (newVal, oldVal) {
if (newVal !== oldVal) {
vm.loading = true;
//TODO: Can we minimize the flicker?
$timeout(function () {
onInit();
}, 100);
}
});
}
}
angular.module("umbraco").controller("Umbraco.Editors.Content.Apps.ContentController", ContentAppContentController);

View File

@@ -22,12 +22,8 @@
//determine a variant is 'dirty' (meaning it will show up as save-able) if it's
// * the active one
// * it's editor is in a $dirty state
// * it's umbContent app viewModel (if any) is in a $dirty state
// * it is in NotCreated state
var contentApp = _.find(variant.apps, function(app) {
return app.alias === "umbContent";
});
return (variant.active || variant.isDirty || (contentApp && contentApp.viewModel && contentApp.viewModel.isDirty));
return (variant.active || variant.isDirty);
}
function pristineVariantFilter(variant) {

View File

@@ -16,7 +16,7 @@
<a href="" class="umb-action-link" ng-click="showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label">
<localize key="create_newFolder">New folder</localize>
<localize key="create_newFolder">New folder</localize>...
</span>
</a>
</li>

View File

@@ -20,7 +20,7 @@ function DictionaryEditController($scope, $routeParams, $location, dictionaryRes
vm.page.menu.currentNode = null;
vm.description = "";
vm.showBackButton = true;
vm.save = saveDictionary;
vm.back = back;
@@ -102,9 +102,9 @@ function DictionaryEditController($scope, $routeParams, $location, dictionaryRes
});
}
}
function back() {
$location.path("settings/dictionary/list");
$location.path(vm.page.menu.currentSection + "/dictionary/list");
}
$scope.$watch("vm.content.name", function (newVal, oldVal) {

View File

@@ -25,7 +25,7 @@
<a href="" ng-click="showCreateDocTypeCollection()" class="umb-action-link">
<i class="large icon icon-thumbnail-list"></i>
<span class="menu-label">
Document Type Collection
Document Type Collection...
<!-- <localize key="content_documentType_collection">Document Type Collection</localize>-->
</span>
</a>
@@ -33,7 +33,7 @@
<li data-element="action-folder" ng-if="model.allowCreateFolder" class="umb-action">
<a href="" ng-click="showCreateFolder()" class="umb-action-link">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</a>
</li>
</ul>

View File

@@ -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" }]
}
]
},

View File

@@ -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);

View File

@@ -10,11 +10,10 @@
<small><localize key="contentTypeEditor_allowAsRootDescription" /></small>
</div>
<div class="sub-view-column-right">
<umb-toggle
data-element="permissions-allow-as-root"
checked="model.allowAsRoot"
on-click="vm.toggle()"
hotkey="alt+shift+r">
<umb-toggle data-element="permissions-allow-as-root"
checked="model.allowAsRoot"
on-click="vm.toggleAllowAsRoot()"
hotkey="alt+shift+r">
</umb-toggle>
</div>
@@ -28,14 +27,13 @@
</div>
<div class="sub-view-column-right">
<umb-child-selector
selected-children="vm.selectedChildren"
available-children="vm.contentTypes"
parent-name="model.name"
parent-icon="model.icon"
parent-id="model.id"
on-add="vm.addChild"
on-remove="vm.removeChild">
<umb-child-selector selected-children="vm.selectedChildren"
available-children="vm.contentTypes"
parent-name="model.name"
parent-icon="model.icon"
parent-id="model.id"
on-add="vm.addChild"
on-remove="vm.removeChild">
</umb-child-selector>
</div>
@@ -44,18 +42,20 @@
<div class="sub-view-columns">
<div class="sub-view-column-left">
<h5>Content Type Variation</h5>
<small>Define the rules for how this content type's properties can be varied</small>
</div>
<div class="sub-view-column-right">
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.allowCultureVariant" />
Allow varying by Culture
</label>
<h5><localize key="contentTypeEditor_variantsHeading" /></h5>
<small><localize key="contentTypeEditor_variantsDescription" /></small>
</div>
<div class="sub-view-column-right">
<umb-toggle data-element="permissions-allow-culture-variant"
checked="model.allowCultureVariant"
on-click="vm.toggleAllowCultureVariants()"
hotkey="alt+shift+v">
</umb-toggle>
</div>
</div>
</umb-box-content>
</umb-box>
</div>

View File

@@ -19,7 +19,7 @@
<umb-editor-container>
<div class="umb-editor-sub-views" ng-if="!page.loading">
<div id="sub-view-{{$index}}" ng-repeat="app in content.apps track by app.alias">
<umb-editor-sub-view model="app" content="content" />
<umb-editor-sub-view model="app" content="content" />
</div>
</div>
</umb-editor-container>

View File

@@ -16,7 +16,7 @@
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</a>
</li>
</ul>

View File

@@ -25,13 +25,13 @@
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="vm.showCreateFromSnippet()">
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewMacroFromSnippet">>New partial view macro from snippet</localize></span>
<span class="menu-label"><localize key="create_newPartialViewMacroFromSnippet">>New partial view macro from snippet</localize>...</span>
</a>
</li>
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</a>
</li>
</ul>

View File

@@ -18,13 +18,13 @@
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="vm.showCreateFromSnippet()">
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewFromSnippet">New partial view from snippet</localize></span>
<span class="menu-label"><localize key="create_newPartialViewFromSnippet">New partial view from snippet</localize>...</span>
</a>
</li>
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</a>
</li>
</ul>

View File

@@ -282,7 +282,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
});
/** Syncs the renderModel based on the actual model.value and returns a promise */
function syncRenderModel() {
function syncRenderModel(validate) {
var valueIds = $scope.model.value ? $scope.model.value.split(',') : [];
@@ -324,7 +324,10 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
});
validate();
if (validate) {
validate();
}
setSortingState($scope.renderModel);
return $q.when(true);
});
@@ -344,7 +347,10 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
}
}
validate();
if (validate) {
validate();
}
setSortingState($scope.renderModel);
return $q.when(true);
}
@@ -425,7 +431,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
}
function init() {
syncRenderModel().then(function () {
syncRenderModel(false).then(function () {
//everything is loaded, start the watch on the model
startWatch();
subscribe();

View File

@@ -13,7 +13,7 @@
<li class="umb-action">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</a>
</li>
</ul>