{% extends "base.html" %}
{% block title %}Edit {{object.title|default:"Location"}}{% endblock %}
{% block content %}
<main class="col-md-4 ms-sm-auto col-lg-10 px-md-4">
    <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
        <h1 class="h2">Edit Location</h1>
    </div>

    <div style="max-width: 500px; margin-top: 20px;">
        <form method="post">
            {% csrf_token %}
            {% for field in form %}
                <div class="form-group" style="margin-bottom: 16px;">
                    <label for="{{ field.id_for_label }}" style="display: block; font-weight: 600; margin-bottom: 4px;">{{ field.label }}</label>
                    {{ field }}
                    {% if field.errors %}
                        <small class="text-danger">{{ field.errors.0 }}</small>
                    {% endif %}
                </div>
            {% endfor %}
            <button type="submit" class="btn btn-primary">Save</button>
            <a href="{% url 'locations:geolocation_detail' slug=object.uuid %}" class="btn btn-secondary" style="margin-left: 10px;">Cancel</a>
        </form>
    </div>
</main>
{% endblock %}