{% extends "layout.html" %}

{% block content %}
<ol class="breadcrumb">
  <li class="active"><strong>Host</strong>: {{ host.name }}</li>
  {% if host.facts %}
  <li>[ {{ macros.make_link('host.show_facts', 'Facts', host=host.name) }} ]</li>
  {% else %}
    <li>[ No facts available ]</li>
  {% endif %}
</ol>

<table class="list table table-striped table-bordered table-hover table-condensed">
  <thead>
    <tr>
      <th>Playbook</th>
      <th>Executed</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 host.playbooks %}
      <tr>
        <td>{{ macros.make_link('playbook.playbook_results',
          playbook.path|pathtruncate, host=host.name, playbook=playbook.id) }}</td>
        <td>{{ playbook.time_start |datefmt }}</td>
        {{ macros.statslink(stats[playbook.id], 'ok', playbook, host) }}
        {{ macros.statslink(stats[playbook.id], 'changed', playbook, host) }}
        {{ macros.statslink(stats[playbook.id], 'failed', playbook, host) }}
        {{ macros.statslink(stats[playbook.id], 'skipped', playbook, host) }}
        {{ macros.statslink(stats[playbook.id], 'unreachable', playbook, host) }}
      </tr>
    {% endfor %}
  </tbody>
</table>
{% endblock %}
