fix rendering of accompanying course commen with at_date

This commit is contained in:
Julien Fastré 2024-06-07 13:06:46 +02:00
parent 61877e0157
commit ebb856fe85
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -7,10 +7,8 @@
{% endif %}
<a id="comment-{{ comment.id }}" href="{{ '#comment-' ~ comment.id }}" class="fa fa-pencil-square-o fa-fw"></a>
{% set creator = comment.creator is defined ? comment.creator : comment.createdBy %}
{{ 'by'|trans }}<b>{{ creator }}</b>
{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}<br>
{{ 'by'|trans }}
<span class="badge-user">{{ comment.createdBy|chill_entity_render_box({'at_date': comment.createdAt }) }}</span>{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}<br>
<i>{{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }}</i>
</div>
<ul class="record_actions">