{% extends "base.html" %}
{% load staticfiles %}

{% block sidebar %}
{% include "sidebar.html" with active="healing" %}
{% endblock %}

{% block extra_css %}
    <link rel="stylesheet" href="{% static "css/jquery.modal.css" %}">
    <link rel="stylesheet" href="{% static "css/healings.css" %}">
{% endblock %}

{% block header %}
    <h1>Admin/Healing</h1>
{% endblock %}

{% block content %}
<div class="container-fluid">
	<div class="row-fluid">
		<div class="span12">
			<table class="table table-hover">
                <thead>
                    <tr>
                        <th>App</th>
                        <th>Failing</th>
                        <th>Created</th>
                        <th>Start</th>
                        <th>Finish</th>
                    </tr>
                </thead>
                <tbody>
				{% for event in events %}
                    <tr class="{% if event.Error %}error{% endif %}">
                        <td>{{ event.App }}</td>
                        <td>{% if event.FailingNode.Address %}{{ event.FailingNode.Address }}{% else %}{{ event.FailingContainer.ID }}{% endif %}</td>
                        <td>{% if event.CreatedNode.Address %}{{ event.CreatedNode.Address }}{% else %}{{ event.CreatedContainer.ID }}{% endif %}</td>
                        <td>{{ event.StartTime }}</td>
                        <td>{{ event.EndTime }}</td>
                        {% if event.Error %}
                        <td class="to-error">
                            {{ event.Error }}
                        </td>
                        {% endif %}
                    </tr>
				{% endfor %}
                </tbody>
			</table>
		</div>
	</div>
</div>
<div class="modal break-word">
    <p></p>
</div>
{% endblock %}

{% block extra_js %}
<script src="{% static "js/jquery.modal.js" %}"></script>
<script src="{% static "js/healing-modal.js" %}"></script>
{% endblock %}
