{% load i18n %}

{% block errors %}
    <hr class="dark:border-gray-800 my-8">

    <ul>
        {% for error in result.base_errors  %}
            <li>
            {{ error.error }}

            <div class="traceback">{{ error.traceback|linebreaks }}</div></li>
        {% endfor %}

        {% for line, errors in result.row_errors %}
            {% for error in errors %}
                <li x-data="{ open: false }">
                    <div class="bg-red-50 border border-red-200 cursor-pointer mb-4 rounded shadow-sm text-red-500 text-sm dark:bg-red-500/20 dark:border-red-500/20" x-on:click="open = ! open">
                        <div class="border-b border-red-200 flex flex-row font-medium py-3 px-4 dark:border-red-500/20">
                            {% trans "Line number" %}: {{ line }} - {{ error.error }}
                        </div>

                        <div class="px-4 py-3">
                            <code>
                                {{ error.row.values|join:", " }}
                            </code>
                        </div>
                    </div>

                    <div class="block border leading-relaxed rounded p-4 text-sm traceback dark:border-gray-800 dark:text-gray-400 " x-show="open">
                        {{ error.traceback|linebreaks }}
                    </div>
                </li>
            {% endfor %}
        {% endfor %}
    </ul>
{% endblock %}
