{% macro displayValue(field, value) %} {% if field == 'openHours' and is_string(value) %} {% set value = value|json_decode %} {% endif %} {% if field == 'optionValues' %} {% for ov in value %} {% if ov.optionId is defined %} {% set option = helper.findOption(ov.optionId) %} {% set optionName = option.name is defined ? option.name : ( ov.optionId ~ ' (Catégorie supprimée)' ) %}
{{ optionName }} {% if ov.description %} ({{ ov.description }}){% endif %}
{% endif %} {% endfor %} {% elseif field == 'images' %} {% for image in value %} {% if image.fileUrl is defined %} {% set url = image.fileUrl ? image.fileUrl : image.externalImageUrl %} {% endif %} {% endfor %} {% elseif value is iterable %} {% for key, subvalue in value %}
{{ key }} : {{ is_string(subvalue) ? subvalue : subvalue|json_encode }}
{% endfor %} {% else %} {{ is_string(value) ? value : value|json_encode }} {% endif %} {% endmacro %} {% import _self as self %}
{% for field, values in contrib.changeset %} {% endfor %}
{{ field }} {{ self.displayValue(field, values[0]) }} {{ self.displayValue(field, values[1]) }}