{% extends "layout.html" %}

{% block content %}
<div class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary">
  <div class="row">
    <div class="col-xs-12 col-sm-6 col-md-10 col-md-offset-1">
      <h1><strong>All Playbooks</strong></h1>
      <table class="list table table-striped table-bordered table-hover table-condensed">
        <thead>
          <tr>
            <th>Playbook</th>
            <th>Executed</th>
            <th>Hosts</th>
            <th><span class="ok label status-label">OK</span></th>
            <th><span class="changed label status-label">CHANGED</span></th>
            <th><span class="failed label status-label">FAILED</span></th>
            <th><span class="skipped label status-label">SKIPPED</span></th>
            <th><span class="unreachable label status-label">UNREACHABLE</span></th>
          </tr>
        </thead>
        <tbody>
            {% for playbook in playbooks %}
            <tr>
              <td>{{ macros.make_link('playbook.show_playbook', playbook.path|pathtruncate(60),
                playbook=playbook.id) }}</td>
              <td>{{ playbook.time_start |datefmt }}</td>
              <td>{{ playbook.hosts|list|length }}</td>
              <td>{{ stats[playbook.id].ok }}</td>
              <td>{{ stats[playbook.id].changed }}</td>
              <td>{{ stats[playbook.id].failed }}</td>
              <td>{{ stats[playbook.id].skipped }}</td>
              <td>{{ stats[playbook.id].unreachable }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
</div>
{% endblock %}
