{% extends "layout.html" %}
{% block content %}
<h1>Vehicles and Repostajes</h1>
<a href="{{ url_for('add_vehicle') }}" class="btn btn-primary">Add Vehicle</a>
<a href="{{ url_for('add_repostaje') }}" class="btn btn-primary">Add Repostaje</a>
<h2>Vehicles</h2>
<table class="table">
    <thead>
        <tr>
            <th>ID</th>
            <th>License Plate</th>
            <th>Model</th>
        </tr>
    </thead>
    <tbody>
        {% for vehicle in vehicles %}
        <tr>
            <td>{{ vehicle.id }}</td>
            <td>{{ vehicle.license_plate }}</td>
            <td>{{ vehicle.model }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
<h2>Repostajes</h2>
<table class="table">
    <thead>
        <tr>
            <th>ID</th>
            <th>Vehicle</th>
            <th>Amount</th>
            <th>Date</th>
        </tr>
    </thead>
    <tbody>
        {% for repostaje in repostajes %}
        <tr>
            <td>{{ repostaje.id }}</td>
            <td>{{ repostaje.vehicle.license_plate }}</td>
            <td>{{ repostaje.amount }}</td>
            <td>{{ repostaje.date }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}
