diff --git a/CHANGELOG.md b/CHANGELOG.md index 077cc0242..8a7c9bd1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [main] add a "read more..." on comment embeddable when overflown (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604) + * [admin] refactorisation of the admin section: reorganisation of the menu, translations, form types, new entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/592) * [admin] add admin section for languages and countries (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/596) * [activity] activity admin: translations + remove label field for comment on admin activity type (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/587) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/CommentEmbeddable.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/CommentEmbeddable.html.twig index e874819c0..1dcd9cbf7 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/CommentEmbeddable.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/CommentEmbeddable.html.twig @@ -9,7 +9,11 @@ #} {{ opening_box|raw }} {%- if options['limit_lines'] is not null -%} - {% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|join('\n') %} + {% if comment.comment|split('\n')|length > options['limit_lines'] %} + {% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|merge(['(more...)'|trans])|join('\n') %} + {% else %} + {% set content = comment.comment %} + {% endif %} {%- else -%} {% set content = comment.comment %} {%- endif -%} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 34ca5d7c9..0d364cd73 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -62,6 +62,7 @@ Comment: Commentaire Pinned comment: Commentaire épinglé Any comment: Aucun commentaire Read more: Lire la suite +(more...): (suite...) # comment embeddable No comment associated: Aucun commentaire