{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
<div class="column is-4 is-offset-4">
|
|
<h3>Añadir nueva canción</h3>
|
|
<div class="box">
|
|
<form method="POST" action="/add_repostaje">
|
|
<div class="text mb-3">
|
|
<label for="fecha">Fecha:</label>
|
|
<input class="form-control" type="date" id="fecha" name="fecha" required>
|
|
</div>
|
|
|
|
<div class="text mb-3">
|
|
<label for="vehiculo_id">Vehículo:</label>
|
|
<select class="form-control" id="vehiculo_id" name="vehiculo_id" required>
|
|
{% for vehiculo in vehiculos %}
|
|
<option value="{{ vehiculo.id }}">{{ vehiculo.matricula }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="text mb-3">
|
|
<label for="kms">Kilómetros:</label>
|
|
<input class="form-control" type="number" id="kms" name="kms" required>
|
|
</div>
|
|
|
|
<div class="text mb-3">
|
|
<label for="litros">Litros</label>
|
|
<input class="form-control" type="number" id="litros" name="litros" required>
|
|
</div>
|
|
|
|
<div class="text mb-3">
|
|
<label for="importe">Importe</label>
|
|
<input class="form-control" type="number" id="importe" name="importe" required>
|
|
</div>
|
|
|
|
<div class="text mb-3">
|
|
<button type="submit" class="btn app-btn-primary w-100 theme-btn mx-auto">Añadir repostaje</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!--
|
|
<script>
|
|
function updateVehiculo() {
|
|
var vehiculoSelect = document.getElementById("vehiculo_id");
|
|
var selectedVehiculo = vehiculoSelect.options[vehiculoSelect.selectedIndex];
|
|
var matricula = selectedVehiculo.getAttribute("data-matricula");
|
|
document.getElementById("vehiculo").value = artist;
|
|
}
|
|
|
|
// Initialize the vehiculo field with the artist of the first repostaje
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
updateVehiculo();
|
|
});
|
|
</script>
|
|
-->
|
|
</div>
|
|
{% endblock %}
|