{% macro render_changelog(model) %} {% for entry in model.changelog %}
{{ entry.created.strftime('%Y/%m/%d %H:%M') }} {{ entry.user_id }} {% if entry.state_after %}changed
{% for key, value in entry.state_after.items() %}
{%- if not loop.first -%}
{%- if loop.last -%}
and
{%- else -%}
,
{%- endif -%}
{%- endif %} {{ key }} to {{ value|string()|truncate(40) }}
{% endfor %}{% endif %}
{% if entry.remarks %}{{ entry.remarks }}{% endif %}