Highlight blocks that are not available anymore
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
|
||||
<div class="__showcase" ng-style="{'background-color':vm.blockConfigModel.backgroundColor, 'background-image': vm.styleBackgroundImage}">
|
||||
<i ng-if="vm.blockConfigModel.thumbnail == null && vm.elementTypeModel.icon" class="__icon {{ vm.elementTypeModel.icon }}" ng-attr-style="{{'color:'+vm.blockConfigModel.iconColor+' !important'}}" aria-hidden="true"></i>
|
||||
<div class="__showcase"
|
||||
ng-class="{'--error':vm.elementTypeModel === null}"
|
||||
ng-style="{'background-color':vm.blockConfigModel.backgroundColor, 'background-image': vm.styleBackgroundImage}">
|
||||
<i ng-if="vm.blockConfigModel.thumbnail == null" class="__icon {{ vm.elementTypeModel ? vm.elementTypeModel.icon : 'icon-block' }}" ng-attr-style="{{'color:'+vm.blockConfigModel.iconColor+' !important'}}" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="__info">
|
||||
<div class="__info" ng-if="vm.elementTypeModel !== null">
|
||||
<div class="__name" ng-bind="vm.elementTypeModel.name"></div>
|
||||
<div class="__subname" ng-if="vm.elementTypeModel.description" ng-bind="vm.elementTypeModel.description"></div>
|
||||
</div>
|
||||
<div class="__info --error" ng-if="vm.elementTypeModel === null">
|
||||
<div class="__name"><localize key="blockEditor_elementTypeDoesNotExistHeadline">Other</localize></div>
|
||||
<div class="__subname"><localize key="blockEditor_elementTypeDoesNotExistDescription">Other</localize></div>
|
||||
</div>
|
||||
|
||||
<ng-transclude></ng-transclude>
|
||||
|
||||
|
||||
@@ -60,6 +60,14 @@ umb-block-card {
|
||||
background-size: cover;
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&.--error {
|
||||
border: 2px solid @errorBackground;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.__icon {
|
||||
position: absolute;
|
||||
@@ -75,26 +83,35 @@ umb-block-card {
|
||||
.__info {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 11px;// 10 + 1 to compentiate for the -1 substraction in margin-bottom.
|
||||
|
||||
&.--error {
|
||||
background-color: @errorBackground;
|
||||
.__name, .__subname {
|
||||
color: @errorText;
|
||||
}
|
||||
}
|
||||
|
||||
.__name {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
color: @ui-action-type;
|
||||
margin-left: 16px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.__subname {
|
||||
color: @gray-4;
|
||||
font-size: 12px;
|
||||
margin-left: 16px;
|
||||
margin-top: 1px;
|
||||
margin-bottom: -1px;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.__info {
|
||||
.__info:not(.--error) {
|
||||
.__name {
|
||||
color: @ui-action-type-hover;
|
||||
}
|
||||
|
||||
@@ -52,14 +52,9 @@
|
||||
vm.requestRemoveBlockByIndex = function (index) {
|
||||
localizationService.localizeMany(["general_delete", "blockEditor_confirmDeleteBlockTypeMessage", "blockEditor_confirmDeleteBlockTypeNotice"]).then(function (data) {
|
||||
var contentElementType = vm.getElementTypeByKey($scope.model.value[index].contentElementTypeKey);
|
||||
if(contentElementType == null) {
|
||||
contentElementType = {
|
||||
name: "Unavailable ElementType"
|
||||
}
|
||||
}
|
||||
overlayService.confirmDelete({
|
||||
title: data[0],
|
||||
content: localizationService.tokenReplace(data[1], [contentElementType.name]),
|
||||
content: localizationService.tokenReplace(data[1], [contentElementType ? contentElementType.name : "(Unavailable ElementType)"]),
|
||||
confirmMessage: data[2],
|
||||
close: function () {
|
||||
overlayService.close();
|
||||
@@ -96,7 +91,7 @@
|
||||
if (vm.elementTypes) {
|
||||
return vm.elementTypes.find(function (type) {
|
||||
return type.key === key;
|
||||
});
|
||||
}) || null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -104,8 +99,11 @@
|
||||
|
||||
//we have to add the 'alias' property to the objects, to meet the data requirements of itempicker.
|
||||
var selectedItems = Utilities.copy($scope.model.value).forEach((obj) => {
|
||||
obj.alias = vm.getElementTypeByKey(obj.contentElementTypeKey).alias;
|
||||
return obj;
|
||||
var elementType = vm.getElementTypeByKey(obj.contentElementTypeKey);
|
||||
if(elementType) {
|
||||
obj.alias = elementType.alias;
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
|
||||
var availableItems = vm.getAvailableElementTypes()
|
||||
@@ -183,31 +181,37 @@
|
||||
|
||||
vm.openBlockOverlay = function (block) {
|
||||
|
||||
localizationService.localize("blockEditor_blockConfigurationOverlayTitle", [vm.getElementTypeByKey(block.contentElementTypeKey).name]).then(function (data) {
|
||||
var elementType = vm.getElementTypeByKey(block.contentElementTypeKey);
|
||||
|
||||
var clonedBlockData = Utilities.copy(block);
|
||||
vm.openBlock = block;
|
||||
if(elementType) {
|
||||
localizationService.localize("blockEditor_blockConfigurationOverlayTitle", [elementType.name]).then(function (data) {
|
||||
|
||||
var overlayModel = {
|
||||
block: clonedBlockData,
|
||||
title: data,
|
||||
view: "views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html",
|
||||
size: "small",
|
||||
submit: function(overlayModel) {
|
||||
loadElementTypes()// lets load elementType again, to ensure we are up to date.
|
||||
TransferProperties(overlayModel.block, block);// transfer properties back to block object. (Doing this cause we dont know if block object is added to model jet, therefor we cant use index or replace the object.)
|
||||
overlayModel.close();
|
||||
},
|
||||
close: function() {
|
||||
editorService.close();
|
||||
vm.openBlock = null;
|
||||
}
|
||||
};
|
||||
var clonedBlockData = Utilities.copy(block);
|
||||
vm.openBlock = block;
|
||||
|
||||
// open property settings editor
|
||||
editorService.open(overlayModel);
|
||||
var overlayModel = {
|
||||
block: clonedBlockData,
|
||||
title: data,
|
||||
view: "views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html",
|
||||
size: "small",
|
||||
submit: function(overlayModel) {
|
||||
loadElementTypes()// lets load elementType again, to ensure we are up to date.
|
||||
TransferProperties(overlayModel.block, block);// transfer properties back to block object. (Doing this cause we dont know if block object is added to model jet, therefor we cant use index or replace the object.)
|
||||
overlayModel.close();
|
||||
},
|
||||
close: function() {
|
||||
editorService.close();
|
||||
vm.openBlock = null;
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
// open property settings editor
|
||||
editorService.open(overlayModel);
|
||||
|
||||
});
|
||||
} else {
|
||||
alert("Cannot be edited cause ElementType does not exist.");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -35,17 +35,20 @@
|
||||
};
|
||||
|
||||
vm.openElementType = function(elementTypeKey) {
|
||||
var elementTypeId = vm.getElementTypeByKey(elementTypeKey).id;
|
||||
const editor = {
|
||||
id: elementTypeId,
|
||||
submit: function (model) {
|
||||
editorService.close();
|
||||
},
|
||||
close: function () {
|
||||
editorService.close();
|
||||
}
|
||||
};
|
||||
editorService.documentTypeEditor(editor);
|
||||
var elementType = vm.getElementTypeByKey(elementTypeKey);
|
||||
if (elementType) {
|
||||
var elementTypeId = elementType.id;
|
||||
const editor = {
|
||||
id: elementTypeId,
|
||||
submit: function (model) {
|
||||
editorService.close();
|
||||
},
|
||||
close: function () {
|
||||
editorService.close();
|
||||
}
|
||||
};
|
||||
editorService.documentTypeEditor(editor);
|
||||
}
|
||||
};
|
||||
|
||||
vm.createElementTypeAndCallback = function(callback) {
|
||||
@@ -110,7 +113,7 @@
|
||||
|
||||
overlayService.confirmRemove({
|
||||
title: data[0],
|
||||
content: localizationService.tokenReplace(data[1], [settingsElementType.name]),
|
||||
content: localizationService.tokenReplace(data[1], [(settingsElementType ? settingsElementType.name : "(Unavailable ElementType)")]),
|
||||
close: function () {
|
||||
overlayService.close();
|
||||
},
|
||||
|
||||
@@ -1856,6 +1856,8 @@ Mange hilsner fra Umbraco robotten
|
||||
<key alias="blockHasChanges">Du har lavet ændringer til dette indhold. Er du sikker på at du vil kassere dem?</key>
|
||||
<key alias="confirmCancelBlockCreationHeadline">Annuller oprettelse?</key>
|
||||
<key alias="confirmCancelBlockCreationMessage"><![CDATA[Er du sikker på at du vil annullere oprettelsen.]]></key>
|
||||
<key alias="elementTypeDoesNotExistHeadline">Error!</key>
|
||||
<key alias="elementTypeDoesNotExistDescription">The ElementType of this block does not exist anymore</key>
|
||||
</area>
|
||||
|
||||
</language>
|
||||
|
||||
@@ -2472,6 +2472,8 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="blockHasChanges">You have made changes to this content. Are you sure you want to discard them?</key>
|
||||
<key alias="confirmCancelBlockCreationHeadline">Discard creation?</key>
|
||||
<key alias="confirmCancelBlockCreationMessage"><![CDATA[Are you sure you want to cancel the creation.]]></key>
|
||||
<key alias="elementTypeDoesNotExistHeadline">Error!</key>
|
||||
<key alias="elementTypeDoesNotExistDescription">The ElementType of this block does not exist anymore</key>
|
||||
</area>
|
||||
<area alias="contentTemplatesDashboard">
|
||||
<key alias="whatHeadline">What are Content Templates?</key>
|
||||
|
||||
@@ -2492,6 +2492,8 @@ To manage your website, simply open the Umbraco back office and start adding con
|
||||
<key alias="blockHasChanges">You have made changes to this content. Are you sure you want to discard them?</key>
|
||||
<key alias="confirmCancelBlockCreationHeadline">Discard creation?</key>
|
||||
<key alias="confirmCancelBlockCreationMessage"><![CDATA[Are you sure you want to cancel the creation.]]></key>
|
||||
<key alias="elementTypeDoesNotExistHeadline">Error!</key>
|
||||
<key alias="elementTypeDoesNotExistDescription">The ElementType of this block does not exist anymore</key>
|
||||
</area>
|
||||
<area alias="contentTemplatesDashboard">
|
||||
<key alias="whatHeadline">What are Content Templates?</key>
|
||||
|
||||
Reference in New Issue
Block a user