From 2f5fecf414ca2269f013d08d6989ed35da727915 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 1 Feb 2022 14:56:50 +0100 Subject: [PATCH] notifications: fix comments counter --- .../Resources/views/Notification/_list_item.html.twig | 11 +++++++---- .../translations/messages+intl-icu.fr.yaml | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig index e1f48789c..817f7e6a7 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/_list_item.html.twig @@ -72,10 +72,13 @@
- {# TODO twig extension to count comments #} -
- 4 commentaires -
+ {% if c.notification.comments|length > 0 %} +
+ + {{ 'notification.counter comments'|trans({'nb': c.notification.comments|length }) }} + +
+ {% endif %}
diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index 7a5b328f4..4bb7a6340 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -29,3 +29,11 @@ notification: few {# non-lues} other {# non-lues} } + + counter comments: >- + {nb, plural, + =0 {Aucun commentaire} + one {# commentaire} + few {# commentaires} + other {# commentaires} + } \ No newline at end of file