{% extends "layout.html" %}

{% block content %}

<h1>Buildslaves</h1>

<div class="column">

<table class="info">

<tr>
  <th>Name</th>
  {%- if show_builder_column %}
    <th>Builders</th>
  {%- endif %}
  <th>BuildBot</th>
  <th>Admin</th>
  <th>Last heard from</th>
  <th>Connects/Hour</th>
  <th>Status</th>
</tr>

{% for s in slaves %}
  <tr class="{{ loop.cycle('alt','') }}">
  <td><b><a href="{{ s.link }}">{{ s.name }}</a></b></td>
  
  {%- if show_builder_column %}
    <td>
    {%- if s.builders %}
      {%- for b in s.builders %}
        <a href="{{ b.link }}">{{ b.name }}</a>
      {%- endfor %}
    {%- else %}
      <span class="Warning">no builders</span>
    {%- endif -%}
    </td>
  {%- endif %}


  <td>{{ s.version or '-' }}</td>
 
  {% if s.connected %}
    <td>
    {%- if s.admin -%}
      Admin: {{ s.admin|email }}
    {%- endif -%}
    </td>
    
    <td>
    {%- if s.last_heard_from_age -%}
      {{ s.last_heard_from_age }} <small>({{ s.last_heard_from_time }})</small>
    {%- endif -%}
    </td>
        
  {% else %}
    <td>-</td>
    <td>-</td>
  {% endif %}

    <td>
    {{ s.connectCount }}
    </td>
        
  {% if s.connected %}
    {% if s.running_builds %}
      <td class="building">Running {{ s.running_builds }} build(s)</td>
    {% else %}
      <td class="idle">Idle</td>
    {% endif %}
        
  {% else %}
    <td class="offline">Not connected</td>
  {% endif %}
  
  </tr>
{% endfor %}
</table>

</div>
  
{% endblock %}
