{% extends "base.html" %}

{% block title %}Oozappa{% endblock %}

{% block headline %}Jobsets{% endblock %}

{% block body %}
<div>
  <table class="striped rounded">
  <thead><tr><th>Jobset title</th><th>Description</th></tr></thead>
    <tbody>
  {% for jobset in jobset_list %}
      <tr>
        <td><a href="{{ url_for('jobset', jobset_id=jobset.id) }}">{{ jobset.title }}</a></td>
        <td>{{ jobset.description }}</td>
      </tr>
  {% endfor %}
    </tbody>
  </table>
  </div>
  <div>
  {% if executelog_list %}
  <div>
    <h3 class="lead">Execute Logs</h3>
    <table class="striped rounded">
    <thead><tr><th>Jobset</th><th>Started</th><th>Finished</th><th>Time in sec.</th><th>Result</th></tr></thead>
      <tbody>
    {% for el in executelog_list %}
        <tr>
          <td>{{ el.jobset.title }}</td>
          <td>{{ el.started|datetimefmt }}</td>
          <td>{{ el.finished|datetimefmt }}</td>
          <td>{{ el.execute_time() }}</td>
          <td>
            <a href="{{ url_for('get_execute_log', id=el.id) }}">
              {% if el.success %}<li class="success alert">Success</li>
              {% else %}<li class="danger alert">Fail</li>{% endif %}
            </a>
          </td>
        </tr>
    {% endfor %}
      </tbody>
    </table>
  </div>
  {% endif %}
{% endblock %}