From 67a2387b31b7e112a8140b50471a180de9d603b7 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Tue, 8 Feb 2022 15:19:33 +0000 Subject: [PATCH] [CARDS][Note] Removed note's complementary info related to the current user everywhere, which was criticized from being redundant --- templates/cards/blocks/note.html.twig | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/templates/cards/blocks/note.html.twig b/templates/cards/blocks/note.html.twig index c2ffdad38f..d7572de13c 100644 --- a/templates/cards/blocks/note.html.twig +++ b/templates/cards/blocks/note.html.twig @@ -132,15 +132,25 @@ {% set actor_count = complementary_info['actors'] | length %} {% set counter = 0 %} {% for complementary_info_actor in complementary_info['actors'] %} - {% if complementary_info_actor is defined %} - {{ complementary_info_actor.getNickname() }}{% if actor_count > 1 and counter < actor_count - 2 %}{{ ', ' | trans }}{% endif %} - {% if counter == actor_count - 2 %} - {{ ' and ' | trans }} + {% if app.user is not null %} + {% if complementary_info_actor is defined and complementary_info_actor.getNickname() != app.user.nickname %} + {{ complementary_info_actor.getNickname() }}{% if actor_count > 1 and counter < actor_count - 2 %}{{ ', ' | trans }}{% endif %} + {% if counter == actor_count - 2 %} + {{ ' and ' | trans }} + {% endif %} + {% set counter = counter + 1 %} + {% endif %} + {% else %} + {% if complementary_info_actor is defined %} + {{ complementary_info_actor.getNickname() }}{% if actor_count > 1 and counter < actor_count - 2 %}{{ ', ' | trans }}{% endif %} + {% if counter == actor_count - 2 %} + {{ ' and ' | trans }} + {% endif %} + {% set counter = counter + 1 %} {% endif %} {% endif %} - {% set counter = counter + 1 %} {% endfor %} - {% if complementary_info['action'] is defined and not null %} + {% if complementary_info['action'] is defined and not null and counter > 0 %} {% if counter > 1 %} {{ ' have ' | trans }} {% else %}