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.durationTime|date('H:i') }} {% if activity.comment.comment is not empty %} -
- {{ 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) %}
-
{% if activity.comment.comment is empty %}{{ 'No comments'|trans }}{% else %}
{{ activity.comment.comment|nl2br }}
{% endif %}
+
{% if activity.comment.comment is empty %}{{ 'No comments'|trans }}{% else %}{{ activity.comment|chill_entity_render_box({'metadata': false}) }}{% endif %}
{{ 'Reasons'|trans }}
{%- if activity.reasons is empty -%} diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index 184bbbe33..1629410af 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -4,7 +4,6 @@ namespace Chill\DocStoreBundle\Form; use Chill\DocStoreBundle\Entity\Document; -use Chill\DocStoreBundle\Entity\DocumentCategory; use Chill\DocStoreBundle\Entity\PersonDocument; use Chill\MainBundle\Entity\User; use Symfony\Component\Form\AbstractType; @@ -12,15 +11,13 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Doctrine\ORM\EntityRepository; -use Chill\MainBundle\Form\Type\AppendScopeChoiceTypeTrait; -use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Doctrine\Persistence\ObjectManager; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ScopePickerType; use Symfony\Component\Form\Extension\Core\Type\TextType; -use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Chill\MainBundle\Form\Type\ChillTextareaType; class PersonDocumentType extends AbstractType @@ -62,7 +59,7 @@ class PersonDocumentType extends AbstractType { $builder ->add('title', TextType::class) - ->add('description', TextareaType::class, [ + ->add('description', ChillTextareaType::class, [ 'required' => false ]) ->add('object', StoredObjectType::class, [ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/show.html.twig index ac1b18601..1761b4db7 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/show.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/PersonDocument/show.html.twig @@ -45,7 +45,7 @@ {{ 'Any description'|trans }} {% else %}
- {{ 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 @@ {% endif %} - - {{ accompanying_period.remark|chill_print_or_message('No remark', 'blockquote') }} + {% if accompanying_period is not empty %} +
+ {{ accompanying_period.remark|chill_markdown_to_html }} +
+ {% else %} + {{ null|chill_print_or_message('No remark', 'blockquote') }} + {% endif %}