{% load simple_log_tags %}

{% get_type value as value_type %}

{% if value_type == 'bool' %}
    {{ value|yesno }}
{% elif value_type == 'dict' and 'db' in value and 'repr' in value %}
    {{ value.repr|default:'—' }}
{% elif value_type == 'dict' %}
    <dl>
        {% for k, v in value.items %}
            <dt>{{ k }}</dt>
            <dd>{% include 'simple_log/admin/field_value.html' with value=v %}</dd>
        {% endfor %}
    </dl>
{% elif value_type == 'list' %}
    {% if value %}
        <ul>
            {% for val in value %}
                <li>{% include 'simple_log/admin/field_value.html' with value=val %}</li>
            {% endfor %}
        </ul>
    {% else %}
        —
    {% endif %}
{% else %}
    {{ value|default:'—' }}
{% endif %}
