covid-formity/templates/_changelog.html

16 lines
493 B
HTML

{% macro render_changelog(model) %}
{% for entry in model.changelog %}
<p>
<span class="text-muted">{{ entry.created.strftime('%Y/%m/%d %H:%M') }}</span> <b>{{ entry.user_id }}</b> changed
{% for key, value in entry.state_after.items() %}
{%- if not loop.first -%}
{%- if loop.last -%}
and
{%- else -%}
,
{%- endif -%}
{%- endif %} <b>{{ key }}</b> to <code title="{{ value }}">{{ value|string()|truncate(40) }}</code> {% endfor %}
</p>
{% endfor %}
{% endmacro %}