mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Implement attachment CollectionType using stimulus
This commit is contained in:
parent
bf3dba0fb2
commit
8323f374a4
10 changed files with 141 additions and 231 deletions
|
@ -95,9 +95,6 @@ class AttachmentFormType extends AbstractType
|
|||
'label' => 'attachment.edit.attachment_type',
|
||||
'class' => AttachmentType::class,
|
||||
'disable_not_selectable' => true,
|
||||
'attr' => [
|
||||
'class' => 'attachment_type_selector',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('showInTable', CheckboxType::class, [
|
||||
|
@ -139,9 +136,9 @@ class AttachmentFormType extends AbstractType
|
|||
'mapped' => false,
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'class' => 'file',
|
||||
/*'class' => 'file',
|
||||
'data-show-preview' => 'false',
|
||||
'data-show-upload' => 'false',
|
||||
'data-show-upload' => 'false',*/
|
||||
],
|
||||
'constraints' => [
|
||||
//new AllowedFileExtension(),
|
||||
|
@ -186,4 +183,9 @@ class AttachmentFormType extends AbstractType
|
|||
'allow_builtins' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'attachment';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,9 +114,11 @@ class StructuralEntityType extends AbstractType
|
|||
|
||||
$resolver->setDefault('empty_message', null);
|
||||
|
||||
$resolver->setDefault('controller', 'elements--selectpicker');
|
||||
|
||||
$resolver->setDefault('attr', static function (Options $options) {
|
||||
$tmp = [
|
||||
'data-controller' => 'elements--selectpicker',
|
||||
'data-controller' => $options['controller'],
|
||||
'data-live-search' => true,
|
||||
'title' => 'selectpicker.nothing_selected',
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue