mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
refactor file drop widget
This commit is contained in:
@@ -15,11 +15,10 @@ use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||
use Chill\ActivityBundle\Form\Type\PickActivityReasonType;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||
use Chill\DocStoreBundle\Form\CollectionStoredObjectType;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||
@@ -276,16 +275,9 @@ class ActivityType extends AbstractType
|
||||
}
|
||||
|
||||
if ($activityType->isVisible('documents')) {
|
||||
$builder->add('documents', ChillCollectionType::class, [
|
||||
'entry_type' => StoredObjectType::class,
|
||||
$builder->add('documents', CollectionStoredObjectType::class, [
|
||||
'label' => $activityType->getLabel('documents'),
|
||||
'required' => $activityType->isRequired('documents'),
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'button_add_label' => 'activity.Insert a document',
|
||||
'button_remove_label' => 'activity.Remove a document',
|
||||
'empty_collection_explain' => 'No documents',
|
||||
'entry_options' => ['has_title' => true],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -92,7 +92,9 @@
|
||||
{% endif %}
|
||||
|
||||
{%- if edit_form.documents is defined -%}
|
||||
{{ form_row(edit_form.documents) }}
|
||||
{{ form_label(edit_form.documents) }}
|
||||
{{ form_errors(edit_form.documents) }}
|
||||
{{ form_widget(edit_form.documents) }}
|
||||
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-class="Chill\ActivityBundle\Entity\Activity" data-entity-id="{{ entity.id }}"></div>
|
||||
{% endif %}
|
||||
|
||||
@@ -127,4 +129,4 @@
|
||||
|
||||
{% block css %}
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user