diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index ad0e55aa7..3a9a307fd 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -15,7 +15,6 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTra use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; -use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Chill\ActivityBundle\Form\Type\TranslatableActivityType; use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; use Chill\MainBundle\Form\Type\UserPickerType; diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig index fa20d33fc..94a9d9a82 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig @@ -46,12 +46,7 @@
- {{ activity.comment.comment|slice(0, 250) }} {# - sf4 check: if 'slice' could replace 'truncate' filter ? - truncate come with twig-extensions, in conflict with twig 3 - #} -+ {{ activity.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }} {% endif %} {%- if activity.reasons is empty -%} {{ 'No reason associated'|trans }} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig index d788c1cf3..dddd05cf7 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Timeline/activity_person_context.html.twig @@ -13,7 +13,7 @@ {% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), activity) %}
{{ activity.comment.comment|nl2br }}{% endif %}
- {{ document.description }} + {{ document.description|chill_markdown_to_html }}{% endif %} diff --git a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php index a088af573..a6e664769 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php @@ -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 + ]); } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/modules/ckeditor5/index.scss b/src/Bundle/ChillMainBundle/Resources/public/modules/ckeditor5/index.scss index 3e5259af4..5fceab7bc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/modules/ckeditor5/index.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/modules/ckeditor5/index.scss @@ -1,4 +1,8 @@ // set min height for ckeditor .ck-editor__editable { min-height: 150px; +} + +.ck-editor.ck-reset { + margin-bottom: 1.5em; } \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php b/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php index 2de2011a1..b4c146960 100644 --- a/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php +++ b/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php @@ -6,17 +6,16 @@ use Chill\MainBundle\Entity\Center; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -use Symfony\Component\Form\FormEvents; -use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Chill\MainBundle\Form\Type\ChillTextareaType; use Symfony\Component\Form\Extension\Core\Type\DateType; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\MainBundle\Form\Type\UserPickerType; use Symfony\Component\Security\Core\Role\Role; use Chill\PersonBundle\Form\Type\ClosingMotivePickerType; + /** * Class AccompanyingPeriodType * @@ -89,7 +88,7 @@ class AccompanyingPeriodType extends AbstractType ]); } - $builder->add('remark', TextareaType::class, [ + $builder->add('remark', ChillTextareaType::class, [ 'required' => false ]); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig index 4d82813d0..54908b7cc 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig @@ -48,8 +48,13 @@
+ {{ accompanying_period.remark|chill_markdown_to_html }} ++ {% else %} + {{ null|chill_print_or_message('No remark', 'blockquote') }} + {% endif %}
- {{ task.description }} + {{ task.description|chill_markdown_to_html }}{% endif %} diff --git a/src/Bundle/ChillTaskBundle/Resources/views/Timeline/single_task_transition_person_context.html.twig b/src/Bundle/ChillTaskBundle/Resources/views/Timeline/single_task_transition_person_context.html.twig index ec0c5195d..234bbc134 100644 --- a/src/Bundle/ChillTaskBundle/Resources/views/Timeline/single_task_transition_person_context.html.twig +++ b/src/Bundle/ChillTaskBundle/Resources/views/Timeline/single_task_transition_person_context.html.twig @@ -18,7 +18,7 @@
- {{ event.task.description }} + {{ event.task.description|chill_markdown_to_html }}