From d46304e229eb94f3d72327d0ae9a87eca4c1ec31 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 27 Jan 2023 12:03:12 +0100 Subject: [PATCH] FEATURE [banner][render] display the A icon within accourse banner if user is absent instead of string --- .../Serializer/Normalizer/UserNormalizer.php | 1 + .../ChillMainBundle/Templating/Entity/UserRender.php | 4 ---- .../public/vuejs/AccompanyingCourse/components/Banner.vue | 7 ++++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index a8607cc21..25bcdbc48 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -87,6 +87,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'user_job' => $this->normalizer->normalize($object->getUserJob(), $format, $userJobContext), 'main_center' => $this->normalizer->normalize($object->getMainCenter(), $format, $centerContext), 'main_scope' => $this->normalizer->normalize($object->getMainScope(), $format, $scopeContext), + 'isAbsent' => $object->isAbsent() ]; if ('docgen' === $format) { diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 4f24808d4..43736eb81 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -71,10 +71,6 @@ class UserRender implements ChillEntityRenderInterface $current_date = new DateTimeImmutable(); - if ($entity->isAbsent() && $opts['main_scope']) { - $str .= ' (' . $this->translator->trans('absence.Absent') . ')'; - } - return $str; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue index 7e3b45103..c7c01f78e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue @@ -22,7 +22,12 @@ {{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }} - {{ $t('course.referrer') }}: {{ accompanyingCourse.user.text }} + {{ $t('course.referrer') }}: + {{ accompanyingCourse.user.text }} + + + A +