{% extends "base.html" %} {% block title %}{{ 'Editar' if vehiculo else 'Nuevo' }} Vehículo{% endblock %} {% block extra_css %} .form-card { max-width: 860px; } .section-title { font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); padding-bottom: 10px; border-bottom: 1px solid var(--border); margin: 28px 0 20px; } .section-title:first-of-type { margin-top: 0; } .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; } .col-full { grid-column: 1 / -1; } .col-2 { grid-column: span 2; } {% endblock %} {% block content %}
{# ── IDENTIFICACIÓN ── #}
Identificación {{ '- id' ~ vehiculo['id'] if vehiculo }}
{# ── CARACTERÍSTICAS TÉCNICAS ── #}
Características técnicas
{% if vehiculo %} {% set sit = vehiculo['situacion'] or '' %} {% if sit | upper == 'BAJA' %} {% set color_borde = '#f87171' %} {% set color_fondo = 'rgba(248,113,113,.08)' %} {% elif sit | upper == 'ACTIVO' %} {% set color_borde = '#34d399' %} {% set color_fondo = 'rgba(52,211,153,.08)' %} {% elif sit | upper == 'ALTA' %} {% set color_borde = '#60a5fa' %} {% set color_fondo = 'rgba(96,165,250,.08)' %} {% else %} {% set color_borde = 'var(--border)' %} {% set color_fondo = 'var(--pill-bg)' %} {% endif %} {% set estilo_sit = 'background:' ~ color_fondo ~ ';border:1.5px solid ' ~ color_borde ~ ';color:var(--text);font-weight:600;cursor: not-allowed;' %} {# ── SITUACIÓN Y DESTINO ── #}
Situación y destino (No editable)
{# ── FECHAS Y KILOMETRAJE ── #}
Kilometraje - ITV
{# ── NOTAS ── #}
NOTAS
{# ── DATOS INTERVENIDO ── #}
Datos vehículo intervenido
{% endif %}
{# Cancelar #} {% if origen == 'viat' %} CANCELAR {% elif desde or hasta or q_itv %} CANCELAR {% else %} CANCELAR {% endif %} {% if vehiculo %} {% endif %}
{# ← CIERRE del formulario principal #} {# ── HISTORIAL (fuera del form principal) ── #} {% if vehiculo %}
Historial
{% if historial %}
{% for h in historial %} {% endfor %}
ID Fecha Matrícula Situación Poblacion Unidad Observaciones Acción
{{ h['id'] or '—' }} {{ h['fecha'] | fecha_es }} {{ h['m_oficial'] or '—' }} {{ h['situacion'] or '—' }} {{ h['poblacion'] or '—' }} {{ h['unidad'] or '—' }} {{ h['observaciones'] or '—' }}
{% else %}

No hay entradas en el historial de este vehículo.

{% endif %} {# Formulario añadir entrada #}

Añadir entrada al historial

{% endif %} {% if vehiculo %} {# ── DOCUMENTOS PDF ── #}
Documentos PDF
{# Listado de documentos existentes #} {% if documentos %}
{% for doc in documentos %} {% endfor %}
Nombre Fecha Acciones
{{ doc['nombre'] }}
{{ doc['fecha'] }}
{% else %}

No hay documentos adjuntos para este vehículo.

{% endif %} {# Formulario subir nuevo documento #}

Añadir documento <5Mb

{% endif %}
{# ← cierre de form-card #} {% endblock %}