{% extends "layout.html" %}

{% block content %}
<ol class="breadcrumb">
  <li>{{ macros.make_link('playbook', 'Playbook', playbook=play.playbook.id) }}</li>
  <li class="active"><strong>Play</strong>{% if play.name %}: "{{play.name}}"{% endif %}</li>
</ol>

<h2>Play information</h2>
<table class="summary table table-striped table-bordered table-hover table-condensed">
  <thead>
    <tr>
      <th>Start</th>
      <th>End</th>
      <th>Duration</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>{{ play.time_start |datetime }}</td>
      <td>{{ play.time_end |datetime }}</td>
      <td>{{ play.duration }}</td>
    </tr>
  </tbody>
</table>

<h2>Tasks</h2>
<table class="tasks table table-striped table-bordered table-hover table-condensed">
  <thead>
    <tr>
      <th>Start</th>
      <th>End</th>
      <th>Duration</th>
      <th>Action</th>
      <th>File</th>
      <th>Line</th>
      <th></th>
    </tr>
  </thead>

  <tbody>
  {% for task in play.tasks.order_by('time_start') %}
  <tr>
    <td>{{ task.time_start |datetime }}</td>
    <td>{{ task.time_end |datetime }}</td>
    <td>{{ task.duration }}</td>
    <td>{{ task.action }}</td>
    <td>{{ task.path }}</td>
    <td>{{ task.lineno }}</td>
    <td>{{ macros.make_link('task', 'details', task=task.id) }}</td>
  </tr>
  {% endfor %}
  </tbody>
</table>
{% endblock %}
