{% 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; } .modal-backdrop { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55); align-items: center; justify-content: center; padding: 24px; } .modal-backdrop.open { display: flex; animation: fadeIn .15s ease; } .modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.35); } .modal-box h3 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; margin-bottom: 8px; color: var(--text); } .modal-box p { font-size: 13px; color: var(--muted); line-height: 1.5; } .modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; } .toast { position: fixed; top: 24px; /* Cámbialo a top: 24px; si lo prefieres arriba */ left: 50%; transform: translateX(-50%); background: var(--surface); padding: 11px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; animation: fadeIn .2s ease; box-shadow: 0 8px 24px rgba(0,0,0,.25); } .toast.ok { border: 1px solid rgba(52,211,153,.45); color: #34d399; } .toast.info { border: 1px solid rgba(52,211,153,.45); color: #155DFC; } .toast.error { border: 1px solid rgba(248,113,113,.45); color: #f87171; } {% 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 %}
{# ← cierre de form-card #}
{# Cancelar #} {% if origen == 'viat' %} VOLVER {% elif desde or hasta or q_itv %} VOLVER {% else %} VOLVER {% 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'] | fecha_es_hora }}
{% else %}

No hay documentos adjuntos para este vehículo.

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

Añadir documento <5Mb

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