{% extends 'base/layout.html' %}
{% load form_helpers %}
{% load i18n %}

{% render_errors form %}

{% block content %}
<form action="" method="post">
    {% csrf_token %}
    <div class="row mb-3">
        <div class="col col-md-6 offset-md-3">
            <div class="card">
                <h2 class="card-header">{% block title %}{% trans "Populate" %} {{ device_bay }}{% endblock %}</h2>
                <div class="card-body">
                    <div class="row mb-3">
                        <label for="id_parent_device" class="col-sm-3 col-form-label text-lg-end">{% trans "Parent Device" %}</label>
                        <div class="col">
                            <input id="id_parent_device" class="form-control" value="{{ device_bay.device }}" disabled />
                        </div>
                    </div>
                    <div class="row mb-3">
                        <label for="id_bay" class="col-sm-3 col-form-label text-lg-end">{% trans "Bay" %}</label>
                        <div class="col">
                            <input id="id_bay" class="form-control" value="{{ device_bay }}" disabled />
                        </div>
                    </div>
                    {% render_form form %}
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col col-md-6 offset-md-3 text-end">
            <a href="{{ return_url }}" class="btn btn-outline-secondary">{% trans "Cancel" %}</a>
            <button type="submit" name="_update" class="btn btn-primary">{% trans "Save" %}</button>
        </div>
    </div>
</form>
{% endblock %}
