{% extends "base.html" %} {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge_nivel_alerta %} {% from "_componentes/iconos.html" import icono %} {% block titulo %}Regla {{ regla.clave }}{% endblock %} {% block contenido %} {%- set PLAZOS = {"24h": "24 horas", "aviso": "Aviso", "inmediato": "Inmediato"} %} {%- set NIVELES = {"critica": "Crítica", "aviso_umbral": "Aviso por umbral", "preventiva": "Preventiva", "informativa": "Informativa"} %} {%- macro valor(v) -%}{{ v if v is not sequence or v is string else v | join(", ") }}{%- endmacro %} {% if guardada %}
{% endif %}{{ regla.criterio_texto }}
{{ error }}
{% endif %} {% if puede_editar %} {% else %}Solo el oficial de cumplimiento cambia una regla.
{% endif %} {% endcall %} {% call tarjeta("Historial", subtitulo=historial | length ~ (" versión" if historial | length == 1 else " versiones"), plano=True) %}| Versión | Vigente desde | Nivel | Plazo | Parámetros | Aprobó | Justificación |
|---|---|---|---|---|---|---|
| {{ h.version }}{% if h.valid_to is none %} vigente{% endif %} | {{ h.vigente_desde.strftime("%d/%m/%Y") }} | {{ badge_nivel_alerta(h.nivel) }} | {{ PLAZOS.get(h.plazo_aviso, "Análisis interno") }} | {% for p in h.parametros %}{{ p.clave }} = {{ valor(p.valor) }}{% if not loop.last %} {% endif %}{% else %}—{% endfor %} |
{{ h.aprobado_por }} | {{ h.justificacion or "—" }} |