FEATURE [banner][render] display the A icon within accourse banner if user is absent instead of string

This commit is contained in:
Julie Lenaerts 2023-01-27 12:03:12 +01:00
parent 4dd81da1ef
commit d46304e229
3 changed files with 7 additions and 5 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -22,7 +22,12 @@
<i>{{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}</i>
</span>
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
<span class="item-key">{{ $t('course.referrer') }}:</span> <b>{{ accompanyingCourse.user.text }}</b>
<span class="item-key">{{ $t('course.referrer') }}:</span>
<b>{{ accompanyingCourse.user.text }}</b>
<span v-if="accompanyingCourse.user.isAbsent" class="fa-stack fa-holder" title="{{ 'absence.Absent'|trans }}">
<i class="fa fa-circle fa-stack-1x text-danger"></i>
<i class="fa fa-stack-1x text-white">A</i>
</span>
</span>
</span>
</span>