{% extends "base.html" %}

{% block content %}

<div class="page-header">
  <h1>Hosts</h1>
</div>

<ol class="breadcrumb">
  <li><a href="{% url 'service-list' %}">Home</a></li>
  <li class="active">All Hosts</li>
</ol>

<div class="panel panel-default">
    <table class="table table-bordered table-condensed">
      <thead>
        <tr>
          <th>Host</th>
          <th>Farm</th>
        </tr>
      </thead>
{% for name, hosts in host_groups.items %}
<tr>
  <td><a href="{% url 'host-detail' name %}">{{ name }}</a></td>
  <td>
    <ul>
    {% for host in hosts %}
      <li>
        <a href="{% url 'farm-detail' host.farm.id %}">{{ host.farm }}</a>
        <ul>
          {% for project in host.farm.project_set.all %}
          <li><a href="{% url 'project-detail' project.id  %}">{{ project.name }}</a></li>
          {% endfor %}
        </ul>
      </li>
    {% endfor %}
    </ul>
  </td>
</tr>
{% endfor %}
    </table>

</div>

{% endblock %}
