apply ckeditor on multiple entities

Apply ckeditor into:

* activity;
* task;
* document;
* accompanying periods
This commit is contained in:
2021-03-25 21:59:48 +01:00
parent 66e590972a
commit b79ec18a38
12 changed files with 33 additions and 33 deletions

View File

@@ -20,7 +20,7 @@ namespace Chill\MainBundle\Form\Type;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
@@ -44,8 +44,8 @@ class CommentType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('comment', TextareaType::class, [
->add('comment', ChillTextareaType::class, [
'disable_editor' => $options['disable_editor']
])
;
@@ -72,8 +72,12 @@ class CommentType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => CommentEmbeddable::class,
]);
$resolver
->setDefined('disable_editor')
->setAllowedTypes('disable_editor', 'bool')
->setDefaults([
'data_class' => CommentEmbeddable::class,
'disable_editor' => false
]);
}
}

View File

@@ -1,4 +1,8 @@
// set min height for ckeditor
.ck-editor__editable {
min-height: 150px;
}
.ck-editor.ck-reset {
margin-bottom: 1.5em;
}