{% extends 'assets/base.html' %}
{% load i18n %}

{% load bob %}


{% block content %}

<div class="row-fluid">
  <h3>
  {% block form_title %}
    {% trans "Edit assets' location" %}
  {% endblock %}
  </h3>
</div>

<form action="{% url edit_location_data mode='dc' %}" method="post">{% csrf_token %}
  {{ blade_server_formset.management_form }}

  <div class="well">
    <h6>{% trans "Rack information" %}</h6>
    {% for field in chassis_form %}
        {% field_wrapper field %}
    {% endfor %}
  </div>

  <div class="well">
    <h6>{% trans "Chassis blade information" %}</h6>
    <table class="table table-striped table-bordered chassis">
    <tr>
      <th>Barcode</th>
      <th>Serial number</th>
      <th>Slot number</th>
    </tr>
    {% for form in blade_server_formset %}
    <tr>
      <td> {{form.instance.asset.barcode|default:""}} </td>
      <td> {{form.instance.asset.sn|default:""}} </td>
      {% for hidden_field in form.hidden_fields %}
        {{ hidden_field }}
      {% endfor %}
      {% for field in form.visible_fields %}
        <td> {% field_wrapper field %} </td>
      {% endfor %}
    </tr>
    {% endfor %}
    </table>
  </div>

  <div class="row-fluid">
    <div class="span12">
    <div class="form-actions">
      <button name="asset" type="submit" class="btn btn-primary">
        {% trans "Save" %}
      </button>
    </div>
    </div>
  </div>
</form>

{% endblock %}
