{% extends "base.html" %}

{% block title %}Test Reports{% endblock %}

{% block head %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="{{ config.static('list.css') }}">
{% endblock %}

{% block content %}
    <div class="list-container">
        <h2>Archived Test Reports</h2>
        {% for report in reports %}
        <a class='test-report' href="{{ config.url('archive', report['folder_name'], 'report.html') }}">
            <div class="item test-report">
                <h3>{{ report['name'] }}</h3>
                <div class="time-container">
                    <div class="start-time">Start: {{ report['start'] }}</div>
                    <div class="end-time">End: {{ report['end'] }}</div>
                </div>
                <div>Version: {{ report['version'] }}</div>
                <div>Successes: {{ report['successful_count'] }} / {{ report['test_count'] }} ({{ report['success_ratio'] * 100 }}%)</div>
                <div class="success-bar-container">
                    <div class="success-bar" style="width: {{ report['success_ratio'] * 100 }}%"></div>
                </div>
            </div>
        </a>
        {% endfor %}
    </div>
{% endblock %}
