mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-07 11:39:30 +00:00
Made synonym form even more space saving
This commit is contained in:
parent
88d34447aa
commit
2c55669ea0
2 changed files with 21 additions and 21 deletions
|
|
@ -52,20 +52,16 @@ class DataSourceSynonymRowType extends AbstractType
|
||||||
'label' => false,
|
'label' => false,
|
||||||
'choices' => $this->buildDataSourceChoices($options['data_sources']),
|
'choices' => $this->buildDataSourceChoices($options['data_sources']),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'row_attr' => [
|
|
||||||
'class' => 'form-floating',
|
|
||||||
],
|
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new Assert\NotBlank(),
|
new Assert\NotBlank(),
|
||||||
],
|
],
|
||||||
|
'row_attr' => ['class' => 'mb-0'],
|
||||||
|
'attr' => ['class' => 'form-select-sm']
|
||||||
])
|
])
|
||||||
->add('locale', LocaleType::class, [
|
->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,
|
'label' => false,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'row_attr' => [
|
|
||||||
'class' => 'form-floating',
|
|
||||||
],
|
|
||||||
// Restrict to languages configured in the language menu: disable ChoiceLoader and provide explicit choices
|
// Restrict to languages configured in the language menu: disable ChoiceLoader and provide explicit choices
|
||||||
'choice_loader' => null,
|
'choice_loader' => null,
|
||||||
'choices' => $this->buildLocaleChoices(true),
|
'choices' => $this->buildLocaleChoices(true),
|
||||||
|
|
@ -73,34 +69,30 @@ class DataSourceSynonymRowType extends AbstractType
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new Assert\NotBlank(),
|
new Assert\NotBlank(),
|
||||||
],
|
],
|
||||||
|
'row_attr' => ['class' => 'mb-0'],
|
||||||
|
'attr' => ['class' => 'form-select-sm']
|
||||||
])
|
])
|
||||||
->add('translation_singular', TextType::class, [
|
->add('translation_singular', TextType::class, [
|
||||||
'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_singular',
|
//'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_singular',
|
||||||
|
'label' => false,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'empty_data' => '',
|
'empty_data' => '',
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new Assert\NotBlank(),
|
new Assert\NotBlank(),
|
||||||
],
|
],
|
||||||
'row_attr' => [
|
'row_attr' => ['class' => 'mb-0'],
|
||||||
'class' => 'form-floating',
|
'attr' => ['class' => 'form-select-sm']
|
||||||
],
|
|
||||||
'attr' => [
|
|
||||||
'placeholder' => '' // to show floating label even when empty
|
|
||||||
]
|
|
||||||
])
|
])
|
||||||
->add('translation_plural', TextType::class, [
|
->add('translation_plural', TextType::class, [
|
||||||
'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_plural',
|
//'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_plural',
|
||||||
'row_attr' => [
|
'label' => false,
|
||||||
'class' => 'form-floating',
|
|
||||||
],
|
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'empty_data' => '',
|
'empty_data' => '',
|
||||||
'constraints' => [
|
'constraints' => [
|
||||||
new Assert\NotBlank(),
|
new Assert\NotBlank(),
|
||||||
],
|
],
|
||||||
'attr' => [
|
'row_attr' => ['class' => 'mb-0'],
|
||||||
'placeholder' => '' // to show floating label even when empty
|
'attr' => ['class' => 'form-select-sm']
|
||||||
]
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="col">{{ form_row(child.translation_singular) }}</div>
|
<div class="col">{{ form_row(child.translation_singular) }}</div>
|
||||||
<div class="col">{{ form_row(child.translation_plural) }}</div>
|
<div class="col">{{ form_row(child.translation_plural) }}</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button type="button" class="btn btn-outline-danger tc-remove" data-action="elements--datasource-synonyms-collection#remove">
|
<button type="button" class="btn btn-outline-danger btn-sm tc-remove" data-action="elements--datasource-synonyms-collection#remove">
|
||||||
<i class="fa fa-trash"></i> {{ 'settings.behavior.data_source_synonyms.collection.remove_entry'|trans }}
|
<i class="fa fa-trash"></i> {{ 'settings.behavior.data_source_synonyms.collection.remove_entry'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -39,6 +39,14 @@
|
||||||
}) }}
|
}) }}
|
||||||
{{ block('widget_container_attributes')|raw }}{% for k,v in _attrs %} {{ k }}="{{ v }}"{% endfor %}
|
{{ block('widget_container_attributes')|raw }}{% for k,v in _attrs %} {{ k }}="{{ v }}"{% endfor %}
|
||||||
>
|
>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col text-center"><strong>{% trans %}settings.behavior.data_source_synonyms.row_type.form.datasource{% endtrans %}</strong></div>
|
||||||
|
<div class="col text-center"><strong>{% trans %}settings.behavior.data_source_synonyms.row_type.form.locale{% endtrans %}</strong></div>
|
||||||
|
<div class="col text-center"><strong>{% trans %}settings.behavior.data_source_synonyms.row_type.form.translation_singular{% endtrans %}</strong></div>
|
||||||
|
<div class="col text-center"><strong>{% trans %}settings.behavior.data_source_synonyms.row_type.form.translation_plural{% endtrans %}</strong></div>
|
||||||
|
<div class="col text-center"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tc-items" data-elements--datasource-synonyms-collection-target="items">
|
<div class="tc-items" data-elements--datasource-synonyms-collection-target="items">
|
||||||
{% for child in form %}
|
{% for child in form %}
|
||||||
{{ _self.renderForm(child) }}
|
{{ _self.renderForm(child) }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue