{% extends 'generic/object_edit.html' %}
{% load form_helpers %}
{% load i18n %}

{% block form %}
    <div class="field-group my-5">
        <div class="row mb-2">
          <h5 class="offset-sm-3">{% trans "Rack" %}</h5>
        </div>
        {% render_field form.site %}
        {% render_field form.location %}
        {% render_field form.name %}
        {% render_field form.status %}
        {% render_field form.role %}
        {% render_field form.description %}
        {% render_field form.tags %}
    </div>

    <div class="field-group my-5">
        <div class="row mb-2">
          <h5 class="offset-sm-3">{% trans "Inventory Control" %}</h5>
        </div>
        {% render_field form.facility_id %}
        {% render_field form.serial %}
        {% render_field form.asset_tag %}
    </div>

    <div class="field-group my-5">
        <div class="row mb-2">
          <h5 class="offset-sm-3">{% trans "Tenancy" %}</h5>
        </div>
        {% render_field form.tenant_group %}
        {% render_field form.tenant %}
    </div>

    <div class="field-group my-5">
        <div class="row mb-2">
          <h5 class="offset-sm-3">{% trans "Dimensions" %}</h5>
        </div>
        {% render_field form.type %}
        {% render_field form.width %}
        {% render_field form.starting_unit %}
        {% render_field form.u_height %}
        <div class="row mb-3">
            <label class="col col-md-3 col-form-label text-lg-end">{% trans "Outer Dimensions" %}</label>
            <div class="col col-md-3 mb-1">
                {{ form.outer_width }}
                <div class="form-text">{% trans "Width" %}</div>
            </div>
            <div class="col col-md-3 mb-1">
                {{ form.outer_depth }}
                <div class="form-text">{% trans "Depth" %}</div>
            </div>
            <div class="col col-md-3 mb-1">
                {{ form.outer_unit }}
                <div class="form-text">{% trans "Unit" %}</div>
            </div>
        </div>
        <div class="row mb-3">
            <label class="col col-md-3 col-form-label text-lg-end">{% trans "Weight" %}</label>
            <div class="col col-md-3 mb-1">
                {{ form.weight }}
                <div class="form-text">{% trans "Weight" %}</div>
            </div>
            <div class="col col-md-3 mb-1">
                {{ form.max_weight }}
                <div class="form-text">{% trans "Maximum Weight" %}</div>
            </div>
            <div class="col col-md-3 mb-1">
                {{ form.weight_unit }}
                <div class="form-text">{% trans "Unit" %}</div>
            </div>
        </div>
        {% render_field form.mounting_depth %}
        {% render_field form.desc_units %}
    </div>

    {% if form.custom_fields %}
      <div class="field-group my-5">
        <div class="row mb-2">
          <h5 class="offset-sm-3">{% trans "Custom Fields" %}</h5>
        </div>
          {% render_custom_fields form %}
      </div>
    {% endif %}

    <div class="field-group my-5">
      {% render_field form.comments %}
    </div>
{% endblock %}
