From 42ac813b6fb7d572148c313b0de4216d0651ca9b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 25 Nov 2025 16:57:57 +0100 Subject: [PATCH] Add a counter for invitations awaiting reply --- .changes/unreleased/Feature-20251125-165811.yaml | 6 ++++++ .../Controller/MyInvitationsController.php | 6 ++++++ .../Resources/views/Invitations/listByUser.html.twig | 2 ++ src/Bundle/ChillCalendarBundle/translations/messages.fr.yml | 1 + 4 files changed, 15 insertions(+) create mode 100644 .changes/unreleased/Feature-20251125-165811.yaml diff --git a/.changes/unreleased/Feature-20251125-165811.yaml b/.changes/unreleased/Feature-20251125-165811.yaml new file mode 100644 index 000000000..3cea3958e --- /dev/null +++ b/.changes/unreleased/Feature-20251125-165811.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Add a counter for invitations awaiting reply +time: 2025-11-25T16:58:11.780678466+01:00 +custom: + Issue: "459" + SchemaChange: No schema change diff --git a/src/Bundle/ChillCalendarBundle/Controller/MyInvitationsController.php b/src/Bundle/ChillCalendarBundle/Controller/MyInvitationsController.php index 7af5ac18f..a99a0abbe 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/MyInvitationsController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/MyInvitationsController.php @@ -47,10 +47,16 @@ class MyInvitationsController extends AbstractController $paginator->getCurrentPageFirstItemNumber() ); + $invitationsWaiting = count($this->inviteRepository->findBy([ + 'user' => $user, + 'status' => 'pending', + ])); + $view = '@ChillCalendar/Invitations/listByUser.html.twig'; return $this->render($view, [ 'invitations' => $invitations, + 'invitationsWaiting' => $invitationsWaiting, 'paginator' => $paginator, 'templates' => $this->docGeneratorTemplateRepository->findByEntity(Calendar::class), ]); diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Invitations/listByUser.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Invitations/listByUser.html.twig index c7b7ecc86..c0b5ede25 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Invitations/listByUser.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Invitations/listByUser.html.twig @@ -8,6 +8,8 @@

{{ 'invite.list.title'|trans }}

+

{{ 'invite.number of invitations waiting'|trans }}: {{ invitationsWaiting }}

+ {% if invitations|length == 0 %}

{{ "invite.list.none"|trans }} diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml index 8717dcd9f..448ee1f35 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml @@ -96,6 +96,7 @@ invite: list: none: Il n'y aucun invitation title: Mes invitations + number of invitations waiting: Invitations en attente # exports Exports of calendar: Exports des rendez-vous