mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
change order for title in stored object
This commit is contained in:
parent
c9ea9112f1
commit
d49859e474
@ -41,6 +41,13 @@ class StoredObjectType extends AbstractType
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
if (true === $options['has_title']) {
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
'label' => 'Title',
|
||||
]);
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('filename', AsyncUploaderType::class)
|
||||
->add('type', HiddenType::class)
|
||||
@ -65,13 +72,6 @@ class StoredObjectType extends AbstractType
|
||||
[$this, 'transformObject'],
|
||||
[$this, 'reverseTransformObject']
|
||||
));
|
||||
|
||||
if ($options['has_title']) {
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
'label' => 'Title',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
@ -81,7 +81,7 @@ class StoredObjectType extends AbstractType
|
||||
|
||||
$resolver
|
||||
->setDefault('has_title', false)
|
||||
->addAllowedValues('has_title', [true, false]);
|
||||
->setAllowedTypes('has_title', ['bool']);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% block stored_object_widget %}
|
||||
{% if form.title is defined %} {{ form_row(form.title) }} {% endif %}
|
||||
<div
|
||||
data-stored-object="data-stored-object"
|
||||
data-label-preparing="{{ ('Preparing'|trans ~ '...')|escape('html_attr') }}"
|
||||
@ -18,6 +19,5 @@
|
||||
{{ form_widget(form.keyInfos, { 'attr': { 'data-stored-object-key': 1 } }) }}
|
||||
{{ form_widget(form.iv, { 'attr': { 'data-stored-object-iv': 1 } }) }}
|
||||
{{ form_widget(form.type, { 'attr': { 'data-async-file-type': 1 } }) }}
|
||||
{% if form.title is defined %} {{ form_row(form.title) }} {% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user