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

{% 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">
                <h5 class="card-header">{% block title %}Populate {{ device_bay }}{% endblock %}</h5>
                <div class="card-body">
                    <div class="row mb-3">
                        <label class="col-sm-3 col-form-label text-lg-end">Parent Device</label>
                        <div class="col">
                            <input class="form-control" value="{{ device_bay.device }}" disabled />
                        </div>
                    </div>
                    <div class="row mb-3">
                        <label class="col-sm-3 col-form-label text-lg-end">Bay</label>
                        <div class="col">
                            <input 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-danger">Cancel</a>
            <button type="submit" name="_update" class="btn btn-primary">Save</button>
        </div>
    </div>
</form>
{% endblock %}
