{% load i18n %}
{% load sentry_helpers %}

{% if value|is_dict %}
    {% if value|length > threshold %}
        <a href="#" class="toggle-expand" onclick="return varToggle(this, $(this).next('.js-expand'));"><span>&#x25b6;</span> {% trans "Expand" %}</a>
    {% endif %}
    <table class="js-expand table vars"{% if value|length > threshold %} style="display:none;"{% endif %}>
        <colgroup>
            <col style="width:100px;">
        </colgroup>
        <tbody>
            {% for k, v in value.iteritems|as_sorted %}
                <tr>
                    <th>{{ k }}</th>
                    {% if v|is_dict %}
                        <td class="values code">
                            {% with value=v %}
                                {% include template %}
                            {% endwith %}
                        </td>
                    {% else %}
                        <td class="code"><pre>{{ v|pprint }}</pre></td>
                    {% endif %}
            {% endfor %}
        </tbody>
    </table>
{% else %}
    {{ value|pprint }}
{% endif %}
