{% if not diff %}
{# If there's no difference don't display it #}
{% else %}
{% if diff.is_html and allow_html_comparison %}
{# If the diff for the field is HTML then we want to provide a link to a side #}
{# by side comparision #}
{{ diff.user_friendly_name }}
{% else %}
{{ diff.user_friendly_name }}
{% endif %}
{% if diff.subitem %}
{# It's a subitem so we need to display it in a special way #}
{% for item_diff in diff.diffs %} {# #}
{% for field, differences in item_diff.items %}
{# #}
{% if differences.is_html and allow_html_comparison %}
{{ field|title }}
{% else %}
{{ field|title }}
{% endif %}
{% for difference in differences.diff %} {# #}
{% render_difference difference %}
{% endfor %} {# #}
{% endfor %}
{% endfor %} {# #}
{% else %}
{# Not a subitem, no special treatment required #}
{% for difference in diff.diffs %}
{% render_difference difference %}
{% endfor %}
{% endif %}