{% extends preflight_base_template %}

{# Copyright 2010 Canonical Ltd.  This software is licensed under the  #}
{# GNU Affero General Public License version 3 (see the file LICENSE). #}

{% load i18n %}

{% block title %}{% trans "Application Pre-Flight Checks" %}{% endblock %}

{% block content %}
<div id="preflight">
  <h1>{% trans "Pre-flight Applications Checks" %}</h1>

  {% for application in applications %}
  <h2>{{ application.name }}</h2>
  <table class="{{ preflight_table_class }}">
    <thead>
      <tr>
        <th>{% trans "Name" %}</th>
        <th>{% trans "Description" %}</th>
        <th>{% trans "Status" %}</th>
      </tr>
    </thead>
    <tbody>
      {% for check in application.checks %}
      <tr>
        <td><strong>{{ check.name }}</strong></td>
        <td class="description">{{ check.description }}</td>
        <td class="status">
        {% if check.passed %}
          <span class="ok" title="{% trans "Passed" %}">☑</span>
        {% else %}
          <span class="error" title="{% trans "Error" %}">☒</span>
        {% endif %}
        </td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
  {% endfor %}

  <h1>{% trans "Versions" %}</h1>
  <table class="{{ preflight_table_class }}">
    <thead>
      <tr>
        <th>{% trans "Library/Package" %}</th>
        <th>{% trans "Version" %}</th>
      </tr>
    </thead>
    <tbody>
      {% for item in versions %}
      <tr>
        <td>{{ item.name }}</td>
        <td>{{ item.version }}</td>
      </tr>
      {% endfor %}
    </tbody>
  </table>

  <h1>{% trans "Settings" %}</h1>
  <dl class="{{ preflight_table_class }}">
  {% for setting in settings %}
    <dt><b>{{ setting.name }}</b></dt>
    <dd>{{ setting.value }}</dd>
    {% if setting.location %}<dd>Location: {{ setting.location}}</dd>{% endif %}
  {% endfor %}
  </dl>
</div>

<p>View generated at: {{ now }}</p>
{% endblock %}
