diff --git a/templates/log_system/details/_extra_collection_element_deleted.html.twig b/templates/log_system/details/_extra_collection_element_deleted.html.twig new file mode 100644 index 00000000..221fae95 --- /dev/null +++ b/templates/log_system/details/_extra_collection_element_deleted.html.twig @@ -0,0 +1,15 @@ +{# @var entry \App\Entity\LogSystem\CollectionElementDeleted #} + +{% import "log_system/details/helper.macro.html.twig" as log_helper %} + +
+ {% trans %}log.collection_deleted.deleted{% endtrans %}: + {{ entity_type_label(entry.deletedElementClass) }} #{{ entry.deletedElementID }} + {% if entry.oldName is not empty %} + ({{ entry.oldName }}) + {% endif %} +
++ {% trans %}log.collection_deleted.on_collection{% endtrans %}: + {{ log_helper.translate_field(entry.collectionName) }} +
\ No newline at end of file diff --git a/templates/log_system/details/helper.macro.html.twig b/templates/log_system/details/helper.macro.html.twig index cc6fedd6..fec32ba2 100644 --- a/templates/log_system/details/helper.macro.html.twig +++ b/templates/log_system/details/helper.macro.html.twig @@ -56,6 +56,17 @@ {% endmacro %} +{% macro translate_field(field) %} + {% set trans_key = 'log.element_edited.changed_fields.'~field %} + {# If the translation key is not found, the translation key is returned, and we dont show the translation #} + {% if trans_key|trans != trans_key %} + {{ ('log.element_edited.changed_fields.'~field) | trans }} + ({{ field }}) + {% else %} + {{ field }} + {% endif %} +{% endmacro %} + {% macro data_change_table(entry) %} {# @var entry \App\Entity\LogSystem\ElementEditedLogEntry|\App\Entity\LogSystem\ElementDeletedLogEntry entry #} @@ -100,15 +111,7 @@ {% for field in fields %}