{# Changes -- This macro is used to render change details in a documents change log entry. -------------------------------------------------------------------------------- {%- import "components/changes.html" as _changes -%} {% call _results.column() %} {{ _changes.changes(item.details) }} {% endcall %} {%- endblock %} -------------------------------------------------------------------------------- #} {% macro changes(entry) -%} {% if entry %}
{% for change_type, change_details in entry.items() %} {% if change_type == 'note' %}
{{ change_details }}
{% elif change_type == 'additions' %} {% for field, value in change_details.items() %}
{{ field }}
{{ value }}
{% endfor %} {% elif change_type == 'updates' %} {% for field, values in change_details.items() %}
{{ field }}
{{ values[0] }}
{{ values[1] }}
{% endfor %} {% elif change_type == 'deletions' %} {% for field, value in change_details.items() %}
{{ field }}
{{ value }}
{% endfor %} {% endif %} {% endfor %}
{% endif %} {%- endmacro %}