
{% extends "layout.html" %}
{% block content %}
{% if data['screenshot_list']|count %}
    <script type="text/javascript">
        $(function() {
            OpenInNewTab = function (url) {
              var win = window.open(url, '_blank');
              win.focus();
            };

            $('#screenshots').puigalleria({
                autoPlay: false,
                panelWidth: 1200,
                panelHeight: 600
            });
        });
    </script>
{% endif %}
<div>
    <h1>Screenshot in Test Batch id: {{ testbatch_id }}</h1>
</div>
{% if data['screenshot_list']|count %}
    <div id="screenshots">
        <ul>
            {% for screenshot in data['screenshot_list'] %}
                <li style="overflow: scroll;">
                    <img onclick="OpenInNewTab('{{ url_for('testbatch.test_batch_report_file', filename = screenshot['path']) }}');" src="{{ url_for('testbatch.test_batch_report_file', filename = screenshot['path']) }}" alt="{{ screenshot['browser_id'] }}" title="{{ screenshot['title'] }}" style="cursor: pointer;"/>
                </li>
            {% endfor %}
        </ul>
    </div>
{% else %}
    <div>
        <h1 class="text-center"> No screenshot in this test batch</h1>
    </div>
{% endif %}
{% endblock %}
