From 05c8e10ef8dfb2e88abf0b661fbb605a9c21755b Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Sat, 9 Jan 2016 14:03:36 +0100 Subject: [PATCH] set disabled state on compositions in overlay + a little bit of restyling --- .../components/umbgroupsbuilder.directive.js | 2 - .../less/components/umb-checkbox-list.less | 36 ++++++-- .../compositions/compositions.controller.js | 27 ++++++ .../compositions/compositions.html | 86 +++++++++++-------- 4 files changed, 104 insertions(+), 47 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index b6fc6eb26c..936057fa6e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -154,8 +154,6 @@ scope.compositionsDialogModel = {}; scope.compositionsDialogModel.title = "Compositions"; scope.compositionsDialogModel.contentType = scope.model; - scope.compositionsDialogModel.availableCompositeContentTypes = scope.model.availableCompositeContentTypes; - scope.compositionsDialogModel.compositeContentTypes = scope.model.compositeContentTypes; scope.compositionsDialogModel.view = "views/common/overlays/contenttypeeditor/compositions/compositions.html"; scope.compositionsDialogModel.show = true; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-checkbox-list.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-checkbox-list.less index 6098eb07e7..f604b79d04 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-checkbox-list.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-checkbox-list.less @@ -6,20 +6,27 @@ .umb-checkbox-list__item { display: flex; align-items: center; - margin-bottom: 1px; - //border-bottom: 1px solid @grayLight; + margin-bottom: 2px; } -.umb-checkbox-list__item.-selected { - background: @blue; - color: white; +.umb-checkbox-list__item:last-child { + border-bottom: none; +} + +.umb-checkbox-list__item:hover { + background-color: @grayLighter; +} + +.umb-checkbox-list__item.-selected, +.umb-checkbox-list__item.-disabled { + background-color: fade(@blueDark, 4%); + font-weight: bold; } .umb-checkbox-list__item-checkbox { display: flex; justify-content: center; align-items: center; - background: @grayLighter; flex: 0 0 30px; height: 30px; margin-right: 10px; @@ -34,7 +41,22 @@ } .umb-checkbox-list__item-text { - font-size: 14px; + font-size: 13px; + margin-bottom: 0; + flex: 1 1 auto; +} + +.umb-checkbox-list__item-text.-faded { + opacity: 0.5; +} + +.umb-checkbox-list__item.-disabled .umb-checkbox-list__item-text { + cursor: not-allowed; +} + +.umb-checkbox-list__item-caption { + font-size: 11px; + margin-left: 2px; } .umb-checkbox-list__no-data { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.controller.js new file mode 100644 index 0000000000..9aba858e7d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.controller.js @@ -0,0 +1,27 @@ + (function() { + "use strict"; + + function CompositionsOverlay($scope) { + + var vm = this; + + vm.isDisabled = isDisabled; + vm.isSelected = isSelected; + + function isSelected(alias) { + if($scope.model.contentType.compositeContentTypes.indexOf(alias) !== -1) { + return true; + } + } + + function isDisabled(alias) { + if($scope.model.contentType.lockedCompositeContentTypes.indexOf(alias) !== -1) { + return true; + } + } + + } + + angular.module("umbraco").controller("Umbraco.Overlays.CompositionsOverlay", CompositionsOverlay); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.html index 31f47702e1..41324ca62b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/compositions/compositions.html @@ -1,39 +1,49 @@ -
- +
+ +
+ +
+ +
+ Inherit tabs and properties from an existing document type. New tabs will be added to the current document type or merged if a tab with an identical name exists. +
+ + + This content type is used in a composition, and therefore cannot be composed itself. + + +
    +
  • + +
    + +
    + + + + +
  • +
+
- -
- Inherit tabs and properties from an existing document type. New tabs will be added to the current document type or merged if a tab with an identical name exists. -
- - - This content type is used in a composition, and therefore cannot be composed itself. - - -