{% extends "layout.html" %}

{% block content %}
<!-- Header container -->
<div class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <h1><strong>Playbook</strong>: {{ macros.make_link('playbook.show_playbook', host.playbook.path, playbook=host.playbook.id) }}</h1>
      <h2>{{ host.playbook.time_start |datefmt }} <span class="fa fa-angle-double-right"></span> {{ host.playbook.time_end |datefmt }}</h2>
      <h1><strong>Host</strong>: {{ host.name }}</h1>
    </div>
  </div>
</div>
<div class="container-fluid container-pf-nav-pf-vertical container-pf-nav-pf-vertical-with-secondary">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <h2><strong>Stats</strong></h2>
      <table class="table table-striped table-bordered table-hover table-condensed">
        <thead>
          <tr>
            <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>
            <tr>
              {{ macros.statslink(host.stats, 'ok', host.playbook, host) }}
              {{ macros.statslink(host.stats, 'changed', host.playbook, host) }}
              {{ macros.statslink(host.stats, 'failed', host.playbook, host) }}
              {{ macros.statslink(host.stats, 'skipped', host.playbook, host) }}
              {{ macros.statslink(host.stats, 'unreachable', host.playbook, host) }}
            </tr>
        </tbody>
      </table>

      <h2><strong>Facts</strong></h2>
      <p>Last updated at {{ host.facts.timestamp |datefmt }}</p>
      <table class="table table-striped table-bordered table-hover table-condensed">
        <thead>
          <tr>
            <th>Fact</th>
            <th>Value</th>
          </tr>
        </thead>
        <tbody>
            {% for fact, value in facts %}
            <tr>
              <td id="{{ fact }}"><a href="#{{ fact }}">{{ fact }}</a></td>
              <td><pre>{{ value | to_nice_json }}</pre></td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
</div>
{% endblock %}
