{% extends 'base.html' %}

{% block title %}Edit Unit {{ unit.unit_id }} - {{ project_name }}{% endblock %}

{% block content %}
<div class="page-header">
    <h1 class="display-5">Edit Unit: {{ unit.unit_id }}</h1>
    <p class="lead">Update the status and location for this unit.</p>
</div>

<div class="row">
    <div class="col-md-8 col-lg-6">
        <div class="card shadow-sm">
            <div class="card-body">
                <form method="post">
                    {% csrf_token %}
                    <div class="mb-3">
                        <label for="{{ form.location_lat.id_for_label }}" class="form-label">Latitude</label>
                        {{ form.location_lat }}
                    </div>
                    <div class="mb-3">
                        <label for="{{ form.location_lon.id_for_label }}" class="form-label">Longitude</label>
                        {{ form.location_lon }}
                    </div>
                    <div class="mb-3">
                        <label for="{{ form.status.id_for_label }}" class="form-label">Status</label>
                        {{ form.status }}
                    </div>
                    <button type="submit" class="btn btn-primary">Save Changes</button>
                    <a href="{% url 'unit_list' %}" class="btn btn-secondary">Cancel</a>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
