{% extends "layout.html" %}

{% block content %}
<ol class="breadcrumb">
  <li class="active"><strong>Host</strong>: {{ host.name }}</li>
</ol>

<table class="list table table-striped table-bordered table-hover table-condensed">
  <thead>
    <tr>
      <th>Playbook</th>
      <th>Executed</th>
      <th>Ok</th>
      <th>Changed</th>
      <th>Failed</th>
      <th>Skipped</th>
      <th>Unreachable</th>
    </tr>
  </thead>
  <tbody>
      {% for playbook in host.playbooks %}
      {% set stats = host.stats.filter_by(playbook_id=playbook.id).one() %}
      <tr>
        <td>{{ macros.make_link('playbook_host', playbook.path, host=host.name, playbook=playbook.id) }}</td>
        <td>{{ playbook.time_start |datetime }}</td>
        {{ macros.statslink(stats, 'ok', playbook, host) }}
        {{ macros.statslink(stats, 'changed', playbook, host) }}
        {{ macros.statslink(stats, 'failed', playbook, host) }}
        {{ macros.statslink(stats, 'skipped', playbook, host) }}
        {{ macros.statslink(stats, 'unreachable', playbook, host) }}
      </tr>
    {% endfor %}
  </tbody>
</table>
{% endblock %}
