{% extends "@DHDoctrineAudit/layout.html.twig" %} {% import '@DHDoctrineAudit/Audit/bootstrap.html.twig' as bootstrap %} {% import '@DHDoctrineAudit/Audit/helper.html.twig' as helper %} {% block dh_doctrine_audit_content %}

{{ entity }}{% if id is not null %}#{{ id }}{% endif %} (most recent first)

{{ bootstrap.badge(entries|length ~ ' operations', 'primary') }}
{% for entry in entries %} {% set diffs = entry.diffs|json_decode(true) %}

{{ helper.humanize(entity, entry) }}

{{ bootstrap.badge(entry.type, bootstrap.label_type(entry.type)) }}
{% if entry.type in ['insert', 'update'] %} {% for key, values in diffs %} {% endfor %}
Property Old value New value
{{ key }} {% if values.old is defined %} {% if values.old is empty %} {{ bootstrap.badge('null', 'secondary') }} {% else %} {{ bootstrap.text(helper.dump(values.old), 'danger') }} {% endif %} {# {% else %}#} {# {% if values['-'] is empty %}#} {# {{ bootstrap.badge('null', 'secondary') }}#} {# {% else %}#} {# {{ bootstrap.text(helper.dump(values['-']), 'danger') }}#} {# {% endif %}#} {% endif %} {% if values.new is defined %} {% if values.new is empty %} {{ bootstrap.badge('null', 'secondary') }} {% else %} {% if values.old is empty %} {{ bootstrap.text(helper.dump(values.new), 'primary') }} {% else %} {{ bootstrap.text(helper.dump(values.new), 'success') }} {% endif %} {% endif %} {# {% else %}#} {# {% if values['+'] is empty %}#} {# {{ bootstrap.badge('null', 'secondary') }}#} {# {% else %}#} {# {% if values['-'] is empty %}#} {# {{ bootstrap.text(helper.dump(values['+']), 'primary') }}#} {# {% else %}#} {# {{ bootstrap.text(helper.dump(values['+']), 'success') }}#} {# {% endif %}#} {# {% endif %}#} {% endif %}
{% endif %}
{% endfor %}
{% if entries.haveToPaginate() %}
{{ pagerfanta(entries, 'twitter_bootstrap4') }}
{% endif %}
{% endblock dh_doctrine_audit_content %}