{% extends "admin_base.html" %}
{% block content %}
<h1 class="mb-4">Edit Car</h1>

<form method="POST" enctype="multipart/form-data">
    {{ form.hidden_tag() }}
    <div class="mb-3">
        {{ form.name.label(class="form-label") }}
        {{ form.name(class="form-control") }}
    </div>
    <div class="mb-3">
        {{ form.capacity.label(class="form-label") }}
        {{ form.capacity(class="form-control") }}
    </div>
    <div class="mb-3">
        {{ form.price_per_day.label(class="form-label") }}
        {{ form.price_per_day(class="form-control") }}
    </div>
    <div class="mb-3">
        {{ form.image.label(class="form-label") }}
        {{ form.image(class="form-control") }}
        {% if car.image %}
        <img src="{{ url_for('static', filename='uploads/' + car.image) }}" alt="{{ car.name }}" class="img-thumbnail mt-2" style="max-width: 200px;">
        {% endif %}
    </div>
    <div class="mb-3">
        {{ form.category.label(class="form-label") }}
        {{ form.category(class="form-select") }}
    </div>
    <div class="mb-3 form-check">
        {{ form.has_ac(class="form-check-input") }}
        {{ form.has_ac.label(class="form-check-label") }}
    </div>
    <div class="mb-3 form-check">
        {{ form.has_usb(class="form-check-input") }}
        {{ form.has_usb.label(class="form-check-label") }}
    </div>
    <div class="mb-3 form-check">
        {{ form.has_player(class="form-check-input") }}
        {{ form.has_player.label(class="form-check-label") }}
    </div>
    <div class="mb-3 form-check">
        {{ form.has_bluetooth(class="form-check-input") }}
        {{ form.has_bluetooth.label(class="form-check-label") }}
    </div>
    <div class="mb-3">
        {{ form.luggage_space.label(class="form-label") }}
        {{ form.luggage_space(class="form-control") }}
    </div>
    {{ form.submit(class="btn btn-primary") }}
</form>
{% endblock %}