{% 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">
                <div class="card-header">{% block title %}Populate {{ device_bay }}{% endblock %}</div>
                <div class="card-body">
                    <div class="form-floating mb-3">
                        <input class="form-control" value="{{ device_bay.device }}" disabled />
                        <label>Parent Device</label>
                    </div>
                    <div class="form-floating mb-3">
                        <input class="form-control" value="{{ device_bay }}" disabled />
                        <label>Bay</label>
                    </div>
                    {% render_form form %}
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col col-md-6 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 %}
