Julien Fastré 9ec4c77fb7
systematically at a parameter 'at_date' when displaying createdBy in twig template
The rendering of the 'createdBy' entity has been updated across various .twig files to include the 'at_date' property. This makes the date an entity was created more explicit, providing clearer information to the user.
2024-06-11 16:55:15 +02:00

42 lines
1.4 KiB
Twig

{% macro updatedBy(entity) %}
<div class="updatedBy">
{% if entity.updatedAt != null %}
{{ 'Last updated on'|trans }}
<span class="date">
{{ entity.updatedAt|format_datetime('medium', 'short') }}
</span>
{% endif %}
{% if entity.updatedBy != null %}
{% if entity.updatedAt != null %}
{{ ', ' ~ 'by_user'|trans }}
{% else %}
{{ 'Last updated by'|trans }}
{% endif %}
<span class="user">
{{ entity.updatedBy|chill_entity_render_box({'at_date': entity.updatedAt }) }}
</span>
{% endif %}
</div>
{% endmacro %}
{% macro createdBy(entity) %}
<div class="createdBy">
{% if entity.createdAt != null %}
{{ 'Created on'|trans }}
<span class="date">
{{ entity.createdAt|format_datetime('medium', 'short') }}
</span>
{% endif %}
{% if entity.createdBy != null %}
{% if entity.createdAt != null %}
{{ ', ' ~ 'by_user'|trans }}
{% else %}
{{ 'Created by'|trans }}
{% endif %}
<span class="user">
{{ entity.createdBy|chill_entity_render_string({'at_date': entity.createdAt}) }}
</span>
{% endif %}
</div>
{% endmacro %}