From 4dc56db018a1b7173fd567c3bc71f20d772b1f5a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 27 Apr 2022 11:51:32 +0200 Subject: [PATCH] show of activity adjusted for private comment --- .../Resources/views/Activity/show.html.twig | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 512557491..b6d375933 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -146,19 +146,18 @@ {% endif %} - {% if t.privateCommentVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) and entity.privateComment.userId is same as(app.user.id) %} - {% if t.privateCommentLabel is not empty %} -
{{ t.privateCommentLabel }}
- {% else %} -
{{ 'activity.private comment'|trans }}
- {% endif %} -
- {%- if entity.privateComment.empty -%} - {{ 'No comment associated'|trans }} - {%- else -%} - {{ entity.privateComment|chill_entity_render_box }} - {%- endif -%} -
+ {% if t.privateCommentVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %} + {% set userID = app.user.id %} + {% if userID in entity.privateComment.comments|keys %} + {% if t.privateCommentLabel is not empty %} +
{{ t.privateCommentLabel }}
+ {% else %} +
{{ 'activity.private comment'|trans }}
+ {% endif %} +
+ {{ entity.privateComment.comments[userID]|chill_entity_render_box }} +
+ {% endif %} {% endif %} {% if t.documentsVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}