{% extends "dashboard_app/base.html" %}
{% load i18n %}
{% load humanize %}
{% load pagination_tags %}


{% block title %}
{{ block.super }} | {% trans "Test Runs" %} | {{ test_run }}
{% endblock %}


{% block breadcrumbs %}
<li><a href="{% url dashboard_app.views.bundle_stream_list %}">{% trans "Bundle Streams" %}</a></li>
<li><a href="{{ test_run.bundle.bundle_stream.get_absolute_url }}">{{ test_run.bundle.bundle_stream }}</a></li>
<li><a href="{{ test_run.get_absolute_url }}">{{ test_run }}</a></li>
{% endblock %}


{% block sidebar %}
<dl>
  <dt>{% trans "Test Run UUID" %}</dt>
  <dd>{{ test_run.analyzer_assigned_uuid }}</dd>
  <dt>{% trans "Test Name" %}</dt>
  <dd>{{ test_run.test }}</dd>
  <dt>{% trans "OS Distribution" %}</dt>
  <dd>{{ test_run.sw_image_desc|default:"<i>Unspecified</i>" }}</dd>
  <dt>{% trans "Bundle information" %}</dt>
  <dd>{{ test_run.bundle.content_sha1 }}</dd>
  <dt>{% trans "Time check performed" %}</dt>
  <dd>{{ test_run.time_check_performed|yesno }}</dd>
  <dt>{% trans "Log analyzed on:" %}</dt>
  <dd>
  {{ test_run.analyzer_assigned_date|naturalday }}
  {{ test_run.analyzer_assigned_date|time }}
  </dd>
  <dt>{% trans "Data uploaded on:" %}</dt>
  <dd>
  {{ test_run.import_assigned_date|naturalday }}
  {{ test_run.import_assigned_date|time }}
  </dd>
  <dt>{% trans "Software Context" %}</dt>
  <dd>
  <a
    href="{% url dashboard_app.views.test_run_software_context test_run.analyzer_assigned_uuid %}"
    >{% trans "more" %}</a>
  </dd>
  <dt>{% trans "Hardware Context" %}</dt>
  <dd>
  <a 
    href="{% url dashboard_app.views.test_run_hardware_context test_run.analyzer_assigned_uuid %}"
    >{% trans "more" %}</a>
  </dd>
</dl>
{% endblock %}


{% block content %}
{% autopaginate test_run.test_results.all 50 as test_results %}
{% if invalid_page %}
<h3>{% trans "There is no content on this page." %}</h3>
<p>{% trans "Try the" %} <a href="{{ test_run.get_absolute_url }}">{% trans "first page" %}</a> {% trans "instead." %}</p>
{% else %}
<table class="data">
  <tr>
    <th>#</th>
    <th>{% trans "Test case" %}</th>
    <th>{% trans "Result" %}</th>
    <th>{% trans "Measurement" %}</th>
  </tr>
  {% for test_result in test_results %}
  <tr>
    <td width="1%">{{ test_result.relative_index }}</td>
    <td>{{ test_result.test_case }}</td>
    <td>
      <a href ="{{test_result.get_absolute_url}}">
      <img src="{{ STATIC_URL }}images/icon-{{ test_result.result_code }}.png"
      alt="{{ test_result.get_result_display }}" width="16" height="16" border="0"/></a>
      <a href ="{{test_result.get_absolute_url}}">{{ test_result.get_result_display }}</a>
    </td>
    {% if test_result.measurement %}
    <td>{{ test_result.measurement|default_if_none:"" }} {{ test_result.units }}</td>
    {% endif %}
  </tr>
  {% endfor %}
</table>
{% paginate %}
{% endif %}
{% endblock %}
