
{% extends "layout.html" %}
{% block content %}
{% if data['crash_list']|count %}
    <script type="text/javascript">
        $(function() {
            $('#accordion').puiaccordion({multiple:true});
        });
    </script>
{% endif %}
<div>
    <h1>Crash in Test Batch id: {{ testbatch_id }}</h1>
</div>
{% if data['crash_list']|count %}
    <div id="accordion">
        {% for crash in data['crash_list'] %}
            <h3>{{ crash.title }}</h3>
            <div>
                <div class='text-center'>
                    <a target='_blank' href='{{ url_for("testbatch.test_batch_report_file", filename = crash.screenshot_path) }}'>
                        <img src='{{ url_for("testbatch.test_batch_report_file", filename = crash.screenshot_path) }}' height='50%' width='50%'/>
                    </a>
                </div>
                <h3>Trace:</h3>
                <p>
                    {% for t in crash.trace_list %}
                        {{ t }}</br>
                    {% endfor %}
                 <p>
                    <a class="unlink" href="{{ url_for('testbatch.report', object_type = 'test_crash', object_id = crash.id) }}" target="_blank" >
                        Report
                    </a>
                </p>
               </p>
            </div>
        {% endfor %}
    </div>
{% else %}
    <div>
        <h1 class="text-center"> No crash in this test batch</h1>
    </div>
{% endif %}
{% endblock %}
