{% extends 'base.html' %}

{% block content %}
<h1>Update Device {{ device.device_id.device_uuid.uuid }}</h1>
<br />
<form id="update_device" method="POST">
    {{ form.hidden_tag() }}
    <fieldset>
        <div class="row mb-3">
            {{ form.update_operational_status.label(class="col-sm-2 col-form-label") }}
            <div class="col-sm-10">
                {% if form.update_operational_status.errors %}
                {{ form.update_operational_status(class="form-control is-invalid") }}
                <div class="invalid-feedback">
                    {% for error in form.update_operational_status.errors %}
                    <span>{{ error }}</span>
                    {% endfor %}
                </div>
                {% else %}
                {{ form.update_operational_status(class="form-select") }}
                {% endif %}
            </div>
        </div> 
        <button type="submit" class="btn btn-primary">
            <i class="bi bi-plus-circle-fill"></i>
            {{ submit_text }}
        </button>
        <button type="button" class="btn btn-block btn-secondary" onclick="javascript: history.back()">
            <i class="bi bi-box-arrow-in-left"></i>
            Cancel
        </button>
    </div>
    </fieldset>
</form>
{% endblock %}