mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 19:19:29 +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,
|
||||
'choices' => $this->buildDataSourceChoices($options['data_sources']),
|
||||
'required' => true,
|
||||
'row_attr' => [
|
||||
'class' => 'form-floating',
|
||||
],
|
||||
'constraints' => [
|
||||
new Assert\NotBlank(),
|
||||
],
|
||||
'row_attr' => ['class' => 'mb-0'],
|
||||
'attr' => ['class' => 'form-select-sm']
|
||||
])
|
||||
->add('locale', LocaleType::class, [
|
||||
//'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,34 +69,30 @@ class DataSourceSynonymRowType extends AbstractType
|
|||
'constraints' => [
|
||||
new Assert\NotBlank(),
|
||||
],
|
||||
'row_attr' => ['class' => 'mb-0'],
|
||||
'attr' => ['class' => 'form-select-sm']
|
||||
])
|
||||
->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,
|
||||
'empty_data' => '',
|
||||
'constraints' => [
|
||||
new Assert\NotBlank(),
|
||||
],
|
||||
'row_attr' => [
|
||||
'class' => 'form-floating',
|
||||
],
|
||||
'attr' => [
|
||||
'placeholder' => '' // to show floating label even when empty
|
||||
]
|
||||
'row_attr' => ['class' => 'mb-0'],
|
||||
'attr' => ['class' => 'form-select-sm']
|
||||
])
|
||||
->add('translation_plural', TextType::class, [
|
||||
'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_plural',
|
||||
'row_attr' => [
|
||||
'class' => 'form-floating',
|
||||
],
|
||||
//'label' => 'settings.behavior.data_source_synonyms.row_type.form.translation_plural',
|
||||
'label' => false,
|
||||
'required' => true,
|
||||
'empty_data' => '',
|
||||
'constraints' => [
|
||||
new Assert\NotBlank(),
|
||||
],
|
||||
'attr' => [
|
||||
'placeholder' => '' // to show floating label even when empty
|
||||
]
|
||||
'row_attr' => ['class' => 'mb-0'],
|
||||
'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_plural) }}</div>
|
||||
<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 }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -39,6 +39,14 @@
|
|||
}) }}
|
||||
{{ 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">
|
||||
{% for child in form %}
|
||||
{{ _self.renderForm(child) }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue