Skip to content

Commit

Permalink
Boolean values are properly displayed now (fix #166) (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper authored Feb 6, 2020
1 parent 045295f commit 9b28c3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DoctrineAuditBundle/Resources/views/Audit/entry.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<td><code>{{ key }}</code></td>
<td>
{% if values.old is defined %}
{% if values.old is empty %}
{% if values.old is null %}
{{ bootstrap.badge('null', 'secondary') }}
{% else %}
{{ bootstrap.text(helper.dump(values.old), 'danger') }}
Expand All @@ -46,10 +46,10 @@
</td>
<td>
{% if values.new is defined %}
{% if values.new is empty %}
{% if values.new is null %}
{{ bootstrap.badge('null', 'secondary') }}
{% else %}
{% if values.old is empty %}
{% if values.old is null %}
{{ bootstrap.text(helper.dump(values.new), 'primary') }}
{% else %}
{{ bootstrap.text(helper.dump(values.new), 'success') }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{% macro dump(value, separator) %}
{% import _self as helper %}
{% import '@DHDoctrineAudit/Audit/bootstrap.html.twig' as bootstrap %}
{% apply spaceless %}
{% if value.label is defined %}
{{ value.label }}
{% elseif value is iterable %}
{% for k, v in value %}
{{ k }}: {{ helper.dump(v) }}{{ separator|default('<br/>')|raw }}
{% endfor %}
{% elseif value is same as(true) %}
{{ 'true' }}
{% elseif value is same as(false) %}
{{ 'false' }}
{% else %}
{{ value }}
{% endif %}
Expand Down

0 comments on commit 9b28c3e

Please sign in to comment.