{% extends "master.html" %}

{% block body %}
<div class="container">
  <nav>
    <ul class="pager">
      <li class="previous">
          <a href="{{ url_for('job_details', compose_pk=_id) }}"><span aria-hidden="true">&larr;</span> Go Back</a>
      </li>
    </ul>
  </nav>
  <table class="table table-hover m-t-10">
    <thead>
      <tr>
        <th>Compose ID</th>
        <th>Family</th>
        <th>Architecture</th>
        <th>Release</th>
        <th>Type</th>
        <th>Status</th>
        <th>Created</th>
        <th>Last updated</th>
        <th>Link</th>
      </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <a href="{{ compose_locations[job_detail.compose_id] }}" target="_blank">{{ job_detail.compose_id }}</a>
            </td>
            <td>
            {{ job_detail.family }}
            </td>
            <td>
            {{ job_detail.arch }}
            </td>
            <td>
            {{ job_detail.release }}
            </td>
            <td>
            {{ job_detail.image_type }}
            </td>
            <td>
                {% if job_detail.status == 's' %}
                <span class="label label-success glyphicon glyphicon-ok">
                {% elif job_detail.status in ('f', 'a') %}
                <span class="label label-danger glyphicon glyphicon-remove">
                {% elif job_detail.status == 'r' %}
                <span class="label label-primary glyphicon glyphicon-refresh">
                {% elif job_detail.status == 'q' %}
                <span class="label label-info glyphicon glyphicon-time">
                {% else %}
                <span class="label label-default">
                {% endif %}
                    {{ job_detail.status }}
                </span>
            </td>
            <td>{{ job_detail.created_on.strftime('%Y-%m-%d %H:%M:%S') }}</td>
            <td>{{ job_detail.last_updated.strftime('%Y-%m-%d %H:%M:%S') }}</td>
            <td><a href="{{ job_detail.image_url }}"><icon class="glyphicon glyphicon-download-alt i-b"></icon> Download Image</a></td>
        </tr>
    </tbody>
  </table>
  <div class="highlight">
      <table class="output_table">
          <tbody>
              {% for line in job_output_lines %}
              <tr>
                  <td class="lineno">
                      <a href="#{{loop.index}}" id="{{ loop.index }}" data-lineno="{{loop.index}}"></a>
                  </td>
                  <td class="lineout">
                    <pre>{{ line }}</pre>
                  </td>
              </tr>
              {% endfor %}
          </tbody>
      </table>
  </div>
</div>
{% endblock %}
