Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_code_style_and_css' into 'release/2.3.0'
Browse files Browse the repository at this point in the history
Fix code style and CSS

See merge request metamodels/core!306
  • Loading branch information
zonky2 committed Jul 19, 2024
2 parents f16b01b + 7b177ac commit 7e47d01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -14,7 +14,7 @@
* @author Christian Schiffler <[email protected]>
* @author Sven Baumann <[email protected]>
* @author Ingolf Steinhardt <[email protected]>
* @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
*/
Expand Down Expand Up @@ -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',
];

/**
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/CoreBundle/Resources/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/CoreBundle/Resources/public/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
}
Expand Down

0 comments on commit 7e47d01

Please sign in to comment.