{% extends "assistant/base.html" %}

{%  block container %} 

<div class="col-md-6 col-md-offset-3">
  <h1>{{ test.title }}
    <small>
      <a href="{% url "test-edit" test.pk %}">[edit]</a> <a href="{% url "test-delete" test.pk %}">[delete]</a>
    </small>
  </h1>
  
  <div class="tags">
    {% for tag in test.tags.names %}
      <span class="label label-success">{{ tag }}</span>
    {% endfor %}
  </div>

  <div class="description">
    {{ test.html|safe }}
  </div>

  {% if current %}
  <form method="POST" id="add-this">
  {% csrf_token %}
  <button class="btn btn-block btn-default">Add this test to the current run</button>
  </form>
  {% endif %}
</div>

<div class="col-md-3">
	<h2>Last runs</h2>
	<ul>
    {% for run in test.last_runs %}
    <li>
      <a href="{% url "run-detail" run.pk %}">{{ run.title }} </a>
      {% for tag in run.tags.names %}
        <span class="label label-success">{{ tag }}</span>
      {% endfor %}
    </li>
    {% endfor %}
	</ul>
</div>

{% endblock %}
