diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index c972f453a..509dcabb0 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -167,6 +167,11 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + public function getCreatedBy(): ?User + { + return $this->getCreator(); + } + public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig index 8812dcdae..156353652 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig @@ -7,10 +7,8 @@ {% endif %} - {% set creator = comment.creator is defined ? comment.creator : comment.createdBy %} - {{ 'by'|trans }}{{ creator }} - - {{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}
+ {{ 'by'|trans }} + {{ comment.createdBy|chill_entity_render_box({'at_date': comment.createdAt }) }}{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}
{{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }}