Made the form more beautiful and space saving

This commit is contained in:
Jan Böhmer 2025-11-09 23:47:20 +01:00
parent 1ec34a2bb0
commit 88d34447aa
3 changed files with 74 additions and 25 deletions

View file

@ -48,16 +48,24 @@ class DataSourceSynonymRowType extends AbstractType
{
$builder
->add('dataSource', ChoiceType::class, [
'label' => 'settings.behavior.data_source_synonyms.row_type.form.datasource',
//'label' => 'settings.behavior.data_source_synonyms.row_type.form.datasource',
'label' => false,
'choices' => $this->buildDataSourceChoices($options['data_sources']),
'required' => true,
'row_attr' => [
'class' => 'form-floating',
],
'constraints' => [
new Assert\NotBlank(),
],
])
->add('locale', LocaleType::class, [
'label' => 'settings.behavior.data_source_synonyms.row_type.form.locale',
//'label' => 'settings.behavior.data_source_synonyms.row_type.form.locale',
'label' => false,
'required' => true,
'row_attr' => [
'class' => 'form-floating',
],
// Restrict to languages configured in the language menu: disable ChoiceLoader and provide explicit choices
'choice_loader' => null,
'choices' => $this->buildLocaleChoices(true),
@ -73,14 +81,26 @@ class DataSourceSynonymRowType extends AbstractType
'constraints' => [
new Assert\NotBlank(),
],
'row_attr' => [
'class' => 'form-floating',
],
'attr' => [
'placeholder' => '' // to show floating label even when empty
]
])
->add('translation_plural', TextType::class, [
'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_plural',
'row_attr' => [
'class' => 'form-floating',
],
'required' => true,
'empty_data' => '',
'constraints' => [
new Assert\NotBlank(),
],
'attr' => [
'placeholder' => '' // to show floating label even when empty
]
]);
}