<!-- templates/cars/reserve_car.html -->

{% extends 'base.html' %}
{% load i18n %}

{% block title %}{% trans "Reserve Car" %}{% endblock %}

{% block content %}
<h1>{% trans "Reserve Car" %}</h1>

<p>{% trans "You are reserving" %}: {{ car }}</p>

<form method="post" class="needs-validation" novalidate>
    {% csrf_token %}
    <div class="mb-3">
        <label for="id_reservation_start">{% trans "Reservation Start Time" %}</label>
        {{ form.reservation_start }}
        {% for error in form.reservation_start.errors %}
            <div class="invalid-feedback">{{ error }}</div>
        {% endfor %}
    </div>
    <div class="mb-3">
        <label for="id_reservation_end">{% trans "Reservation End Time" %}</label>
        {{ form.reservation_end }}
        {% for error in form.reservation_end.errors %}
            <div class="invalid-feedback">{{ error }}</div>
        {% endfor %}
    </div>
    <button type="submit" class="btn btn-primary">{% trans "Reserve" %}</button>
    <a href="{% url 'car_detail' car.pk %}" class="btn btn-secondary">{% trans "Cancel" %}</a>
</form>
{% endblock %}