{% comment %}
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
{% endcomment %}
{% extends "admin/base_site.html" %}
{% load proto_tags %}
{% block extrahead %}
   <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/racks.css" media="all" />
   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
   <script type="text/javascript" src="{{ STATIC_URL }}js/racks.js"></script>
{% endblock %}

{% block content %}

{% for rack in racks %}
<div style="float:left;">
<h2>{{ rack.nome }} ({{ rack.vazio }} ocupado)</h2>
<table class="tabela">
  {% for eq in rack.equipamentos %}
    <tr>
      {% if forloop.first %}
        <td rowspan="{{ rack.altura }}" width="2px" style="background-color:#f00;"></td>
      {% endif %}
    <td style="background-color:#{% if eq.descricao %}000;" rel="tooltip" title="{{ eq.descricao }}"{% else %}fff;"{% endif %} rowspan="{{ eq.tamanho }}" width="140px"></td>
      {% if forloop.first %}
        <td rowspan="{{ rack.altura }}" width="2px" style="background-color:#f00;"></td>
      {% endif %}
    </tr>
    {% for i in eq.range %}<tr></tr>{% endfor %}
  {% endfor %}
</table>
</div>
{% endfor %}
{% endblock %}

