{% extends 'layout.html' %}
{% block content %}
<h1>Summary</h1>
<table class='table table-striped'>
  <thead>
    <tr>
      <th>Hostname</th>
      <th>Configuration version</th>
      <th>Start time</th>
      <th>End time</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{report.node}}</td>
      <td>
        {{report.version}}
      </td>
      <td rel="utctimestamp">
        {{report.start}}
      </td>
      <td rel="utctimestamp">
        {{report.end}}
      </td>
    </tr>
  </tbody>
</table>

<h1>Events</h1>
<table class='table table-striped table-condensed'>
  <thead>
    <tr>
      <th>Resource</th>
      <th>Status</th>
      <th>Changed From</th>
      <th>Changed To</th>
    </tr>
  </thead>
  <tbody>
    {% for event in events %}
    {% if not event.failed and event.item['old'] != event.item['new'] %}
      <tr class='success'>
    {% elif event.failed %}
      <tr class='error'>
    {% endif %}
      <td>{{event.item['type']}}[{{event.item['title']}}]</td>
      <td>{{event.status}}</td>
      <td>{{event.item['old']}}</td>
      <td>{{event.item['new']}}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>

{% endblock content %}
{% block script %}
  <script type='text/javascript'>
    jQuery(function ($) {
      $("[rel=tooltip]").tooltip();
    });
  </script>
{% endblock script %}
