covid-formity/templates/_changelog.html

17 lines
590 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> {% if entry.state_after %}changed
2020-03-27 18:04:29 +00:00
{% 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 %}{% endif %}
{% if entry.remarks %}<i>{{ entry.remarks }}</i>{% endif %}
2020-03-27 18:04:29 +00:00
</p>
{% endfor %}
{% endmacro %}