From bd4e92d8921549e64cac5baaa64a015489e7d557 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 9 Oct 2019 11:06:34 +0300 Subject: [PATCH] multi-enum display as list --- application/Espo/Resources/i18n/en_US/Admin.json | 1 + application/Espo/Resources/metadata/fields/multiEnum.json | 4 ++++ client/src/views/fields/array.js | 7 ++++++- frontend/less/espo/custom.less | 7 +++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json index d6c4a6a4bc..c06a376588 100644 --- a/application/Espo/Resources/i18n/en_US/Admin.json +++ b/application/Espo/Resources/i18n/en_US/Admin.json @@ -188,6 +188,7 @@ "inlineEditDisabled": "Disable Inline Edit", "allowCustomOptions": "Allow Custom Options", "displayAsLabel": "Display as Label", + "displayAsList": "Display as List", "maxCount": "Max Item Count", "accept": "Accept", "displayRawText": "Display raw text (no markdown)" diff --git a/application/Espo/Resources/metadata/fields/multiEnum.json b/application/Espo/Resources/metadata/fields/multiEnum.json index 760348643f..a8735eb1d6 100644 --- a/application/Espo/Resources/metadata/fields/multiEnum.json +++ b/application/Espo/Resources/metadata/fields/multiEnum.json @@ -37,6 +37,10 @@ "name":"displayAsLabel", "type":"bool" }, + { + "name": "displayAsList", + "type":"bool" + }, { "name":"audited", "type":"bool" diff --git a/client/src/views/fields/array.js b/client/src/views/fields/array.js index ef4931c5fe..48ac192661 100644 --- a/client/src/views/fields/array.js +++ b/client/src/views/fields/array.js @@ -395,7 +395,12 @@ define('views/fields/array', ['views/fields/base', 'lib!Selectize'], function (D if (this.displayAsList) { if (!list.length) return ''; - return '
' + list.join('
') + '
'; + var itemClassName = 'multi-enum-item-container'; + if (this.displayAsLabel) { + itemClassName += ' multi-enum-item-label-container'; + } + return '
' + + list.join('
') + '
'; } else if (this.displayAsLabel) { return list.join(' '); } else { diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index 369bd1229e..92e9e872af 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -1041,6 +1041,13 @@ ul.dropdown-menu > li.checkbox:last-child { margin-bottom: 0; } } + + .multi-enum-item-label-container { + margin-bottom: 4px; + } + .multi-enum-item-label-container:last-child { + margin-bottom: 0; + } } .filter > .form-group .field {