From 7b177ac93966c56c59ee54700f083675d992352e Mon Sep 17 00:00:00 2001 From: Ingolf Steinardt Date: Fri, 19 Jul 2024 10:23:06 +0200 Subject: [PATCH] Fix code style and CSS --- .../Table/RenderSettings/JumpToListener.php | 25 ++++++++----------- src/CoreBundle/Resources/public/css/style.css | 5 ++-- .../Resources/public/scss/style.scss | 4 +-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php index 22393f63a..34401887b 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php @@ -3,7 +3,7 @@ /** * This file is part of MetaModels/core. * - * (c) 2012-2023 The MetaModels team. + * (c) 2012-2024 The MetaModels team. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,7 @@ * @author Christian Schiffler * @author Sven Baumann * @author Ingolf Steinhardt - * @copyright 2012-2023 The MetaModels team. + * @copyright 2012-2024 The MetaModels team. * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -42,17 +42,17 @@ class JumpToListener extends AbstractAbstainingListener private const DEFAULT_TYPE = UrlGeneratorInterface::ABSOLUTE_PATH; private const TYPE_MAP = [ - 'absolute_url' => UrlGeneratorInterface::ABSOLUTE_URL, + 'absolute_url' => UrlGeneratorInterface::ABSOLUTE_URL, 'absolute_path' => UrlGeneratorInterface::ABSOLUTE_PATH, 'relative_path' => UrlGeneratorInterface::RELATIVE_PATH, - 'network_path' => UrlGeneratorInterface::NETWORK_PATH, + 'network_path' => UrlGeneratorInterface::NETWORK_PATH, ]; private const TYPE_MAP_INVERSE = [ - UrlGeneratorInterface::ABSOLUTE_URL => 'absolute_url', + UrlGeneratorInterface::ABSOLUTE_URL => 'absolute_url', UrlGeneratorInterface::ABSOLUTE_PATH => 'absolute_path', UrlGeneratorInterface::RELATIVE_PATH => 'relative_path', - UrlGeneratorInterface::NETWORK_PATH => 'network_path', + UrlGeneratorInterface::NETWORK_PATH => 'network_path', ]; /** @@ -168,7 +168,7 @@ public function encodeValue(EncodePropertyValueFromWidgetEvent $event) foreach ($value as $k => $v) { $value[$k]['value'] = \str_replace(['{{link_url::', '}}'], ['', ''], $v['value']); - $value[$k]['type'] = self::TYPE_MAP[$v['type']] ?? self::DEFAULT_TYPE; + $value[$k]['type'] = self::TYPE_MAP[$v['type']] ?? self::DEFAULT_TYPE; } $event->setValue(\serialize($value)); @@ -208,7 +208,7 @@ public function buildWidget(BuildWidgetEvent $event) foreach ((array) $metaModel->getAvailableLanguages() as $strLangCode) { $arrLanguages[$strLangCode] = $this->translator ->trans('LNG.' . $strLangCode, [], 'contao_languages'); - $rowClasses[] = ($strLangCode === $fallback) ? 'fallback_language' : 'normal_language'; + $rowClasses[] = ($strLangCode === $fallback) ? 'fallback_language' : 'normal_language'; } $extra['minCount'] = \count($arrLanguages); @@ -221,16 +221,11 @@ public function buildWidget(BuildWidgetEvent $event) $extra['maxCount'] = 1; $extra['columnFields']['langcode']['options'] = [ - 'xx' => $this->translator - ->trans( - 'jumpTo_allLanguages', - [], - 'tl_metamodel_rendersettings' - ) + 'xx' => $this->translator->trans('jumpTo_allLanguages', [], 'tl_metamodel_rendersettings') ]; } - $extra['columnFields']['type']['options'] = $this->getUrlTypes(); + $extra['columnFields']['type']['options'] = $this->getUrlTypes(); $extra['columnFields']['filter']['options'] = $this->getFilterSettings($model); $event->getProperty()->setExtra($extra); diff --git a/src/CoreBundle/Resources/public/css/style.css b/src/CoreBundle/Resources/public/css/style.css index 1c8c22695..27bb349d9 100644 --- a/src/CoreBundle/Resources/public/css/style.css +++ b/src/CoreBundle/Resources/public/css/style.css @@ -179,12 +179,13 @@ form[id^=mm_] .sort_hint { width: 15%; } #tl_metamodel_rendersettings .jumpTo_page input { - width: 88%; + width: 83%; } #tl_metamodel_rendersettings .jumpTo_filter { width: 55%; } -#tl_metamodel_rendersettings .jumpTo_filter select { +#tl_metamodel_rendersettings .jumpTo_filter select, +#tl_metamodel_rendersettings .jumpTo_filter div.tl_select { width: 100%; } #tl_metamodel_rendersettings .operations { diff --git a/src/CoreBundle/Resources/public/scss/style.scss b/src/CoreBundle/Resources/public/scss/style.scss index 855618291..2192de0cb 100644 --- a/src/CoreBundle/Resources/public/scss/style.scss +++ b/src/CoreBundle/Resources/public/scss/style.scss @@ -159,12 +159,12 @@ form[id^=mm_] .sort_hint { .jumpTo_page { width: 15%; input { - width: 88%; + width: 83%; } } .jumpTo_filter { width: 55%; - select { + select, div.tl_select { width: 100%; } }