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


{% block title %}
{{ block.super }} | {% trans "Test Runs" %} | {{ test_run }} | {% trans "Software Context" %}
{% 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>
<li><a href="{% url dashboard_app.views.test_run_software_context test_run.analyzer_assigned_uuid %}">{% trans "Software Context" %}</a></li>
{% endblock %}


{% block sidebar %}
{% endblock %}


{% block content %}
<h2>Software Packages</h2>
<ul>
{% autopaginate test_run.packages.all as software_packages %}
{% for software_package in software_packages %}
  <li>Package <a href="{{software_package.link_to_packages_ubuntu_com}}">{{software_package.name}}</a> version {{software_package.version}}</li>
{% empty %}
  <em>There are no software packages associated with this test run</em>
{% endfor %}
</ul>
{% paginate %}

<h2>Source Sources</h2>
<ul>
{% for software_source in test_run.sources.all %}
  <li>
  {% if software_source.is_hosted_on_launchpad %}
    Launchpad project <a href="{{ software_source.link_to_project }}">{{ software_source.project_name }}</a>
    from bazaar branch <a href="{{ software_source.link_to_branch }}">{{ software_source.branch_url }}</a>
    {% if software_source.is_tag_revision %}
      at tag {{ software_source.branch_tag }}
    {% else %}
      at revision {{ software_source.branch_revision }}
    {% endif %}
  {% else %}
    Project {{software_source.project_name}} from {{software_source.branch_vcs}}
    branch {{software_source.branch_url}} at revision {{software_source.branch_revision}}
  {% endif %}
  </li>
{% empty %}
  <em>There are no source references associated with this test run</em>
{% endfor %}
</ul>
{% endblock %}
