{% extends "index.html" %}

{% block main_info %}

<div class="card">
  <div class="card-body">
    <table class="table table-responsive-sm table-hover table-outline mb-0">
      <thead class="thead-light">
      <tr>
        <th >id</th>
        <th >name
          <button type="button" class="btn btn-default">
            <span class="nav-icon icon-pencil" aria-hidden="true" aria-label="edit"></span>
          </button>
        </th>
        <th>status</th>
        <th>date</th>
        <th>current jobs</th>
      </tr>
      </thead>
      <tbody>
      <tr>
        {% for wf in workflows %}
      <tr>
        <td >
          <a href='/workflow/{{ wf.id }}'> {{ wf.id }} </a>
        </td>
        <td>
          <a href='/workflow/{{ wf.id }}'> {{ wf.name }} </a>
        </td>
        <td>
          <span class="badge badge-{{ 'success' if wf.status=='Done' else ('danger' if wf.status=='Error' else ('info' if wf.status=='Running' else 'light text-dark'))}}"> {{ wf.status }} </span>
        </td>
        <td>
          <a> {{ wf.started_at|formatdatetime }} </a>
        </td>
        <td>
          <a> {{ wf.jobs_done }}/{{ wf.jobs_total }} </a>
        </td>
      </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>

{% endblock %}
