covid-formity/templates/_changelog.html

16 lines
493 B
HTML
Raw Normal View History

2020-03-27 18:04:29 +00:00
{% 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 %}
2020-03-27 18:04:29 +00:00
</p>
{% endfor %}
{% endmacro %}