diff --git a/app/static/app.css b/app/static/app.css index e3de8b1..e8cfc6d 100644 --- a/app/static/app.css +++ b/app/static/app.css @@ -492,6 +492,7 @@ a.resumen__cifra:hover, button.resumen__cifra:hover { background: var(--color-su .formulario__acciones { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; } .formulario__nota { font-size: 12.5px; color: var(--color-texto-suave); line-height: 1.5; } .subformulario { display: flex; flex-direction: column; gap: 18px; margin: 20px 24px 24px; padding: 20px; border-radius: var(--radio-md); background: var(--color-sutil); border: 1px solid var(--color-borde-suave); } +.subformulario--sin-margen { margin: 0; } .subformulario__titulo { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; } .campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; } .campo__etiqueta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.35; } @@ -798,6 +799,18 @@ textarea.campo__entrada--compacta { min-height: 84px; padding: 10px 12px; } .grafo__leyenda .es-ganadora::before { border-color: var(--tono-peligro); background: var(--tono-peligro-fondo); } .lista-filas--cuerpo > li { padding: 10px 0; } +/* Casos: línea de tiempo (casos/detalle.html) */ +.linea-tiempo { margin: 0; padding: 12px 24px 16px; list-style: none; } +.linea-tiempo__evento { position: relative; display: flex; flex-direction: column; gap: 6px; margin-left: 5px; padding: 12px 0 14px 24px; border-left: 2px solid var(--color-borde-suave); } +.linea-tiempo__evento:last-child { border-left-color: transparent; } +.linea-tiempo__evento::before { content: ""; position: absolute; left: -8px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--punto, var(--color-texto-tenue)); } +.linea-tiempo__fecha { font-family: var(--fuente-mono); font-size: 12.5px; font-weight: 500; color: var(--color-texto); } +.linea-tiempo__evento[data-tipo="apertura"] { --punto: var(--color-marino); } +.linea-tiempo__evento[data-tipo="nota"], .linea-tiempo__evento[data-tipo="documento"] { --punto: var(--color-verde); } +.linea-tiempo__evento[data-tipo="cambio_estado"], .linea-tiempo__evento[data-tipo="asignacion"] { --punto: var(--tono-aviso-punto); } +.linea-tiempo__evento[data-tipo="decision"] { --punto: var(--tono-peligro); } +.casilla-tabla { width: 16px; height: 16px; margin: 0; accent-color: var(--color-verde); } + /* 5.5 Clasificación de riesgo: distribución ------------------------------------------------ */ .distribucion__barra { display: flex; gap: 3px; height: 10px; border-radius: var(--radio-pildora); overflow: hidden; } .distribucion__barra span { flex: var(--n) 1 0; background: var(--punto); transition: opacity 0.15s; } @@ -896,6 +909,7 @@ textarea.campo__entrada--compacta { min-height: 84px; padding: 10px 12px; } .pila { display: flex; flex-direction: column; gap: 16px; } .rejilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; } .contents { display: contents; } +.alinear-final { align-items: flex-end; } /* Ancho mínimo de una tabla dentro de .tabla-contenedor (scroll horizontal propio) */ .ancho-min-560 { min-width: 560px; } .ancho-min-640 { min-width: 640px; } .ancho-min-720 { min-width: 720px; } .ancho-min-820 { min-width: 820px; } .ancho-min-960 { min-width: 960px; } .ancho-min-1040 { min-width: 1040px; } diff --git a/app/templates/alertas/detalle.html b/app/templates/alertas/detalle.html index 79aa5fe..54e747d 100644 --- a/app/templates/alertas/detalle.html +++ b/app/templates/alertas/detalle.html @@ -1,93 +1,139 @@ {% extends "base.html" %} {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge, badge_estado_alerta, badge_nivel_alerta %} -{% from "_componentes/tabla.html" import tabla %} {% from "_componentes/aviso.html" import aviso as aviso_en_linea %} +{% from "_componentes/iconos.html" import icono %} {% from "_componentes/pendiente.html" import pendiente_de_regla %} +{#- Página completa de una alerta (enlaces directos y "Ver detalle completo" del cajón de la + bandeja). Las acciones y sus redirecciones viven aquí. Las acciones del historial se + muestran en crudo (crear, estado:…): las lee el audit trail y los tests. -#} +{% set ancho = "amplio" %} + {% block titulo %}Alerta {{ alerta.id }} · {{ regla.clave }}{% endblock %} {% block contenido %} -
-

← Alertas

-

Alerta #{{ alerta.id }} · {{ regla.clave }} {{ regla.nombre }} {{ pendiente_de_regla(regla.clave) }}

-

{{ badge_nivel_alerta(alerta.nivel) }} {{ badge_estado_alerta(alerta.estado) }} · regla {{ regla.version }} vigente desde {{ regla.vigente_desde.strftime("%d/%m/%Y") }} · plazo: {{ alerta.plazo_aviso or "análisis interno" }}{% if alerta.vence_el %} · vence el {{ alerta.vence_el.strftime("%d/%m/%Y") }}{% endif %}

-
- +{%- set FAMILIAS = {"A": "Umbrales de aviso", "B": "Señales de alerta", "C": "Perfil transaccional", "D": "Riesgo y PEP", "E": "Listas y jurisdicciones"} %} {% if aviso %}{% endif %} + +
+ +
+
+

Alerta #{{ alerta.id }} · {{ regla.clave }}

+

{{ regla.nombre }} {{ pendiente_de_regla(regla.clave) }}

+

+ {{ badge_nivel_alerta(alerta.nivel) }}{{ badge_estado_alerta(alerta.estado) }} + {{ regla.clave }} {{ regla.version }} · {{ FAMILIAS.get(regla.familia, regla.familia) }} + ·vigente desde {{ regla.vigente_desde.strftime("%d/%m/%Y") }} + ·plazo: {{ alerta.plazo_aviso or "análisis interno" }} + {%- if alerta.vence_el %}·vence el {{ alerta.vence_el.strftime("%d/%m/%Y") }}{% endif %} +

+
+
+
+ {% if error %}{{ aviso_en_linea(error, tono="peligro") }}{% endif %} -{% call tarjeta("Regla", subtitulo=regla.criterio_texto) %} -
-
Clave
{{ regla.clave }} · familia {{ regla.familia }}
-
Versión que la produjo
{{ regla.version }} (regla_id {{ regla.id }}){% if regla.valid_to %} {{ badge("sustituida", "aviso") }}{% endif %}
-
Tipo de evaluación
{{ regla.tipo_evaluacion }}
-
Parámetros
{% for k, v in (alerta.evidencia.parametros or {}).items() if not k.startswith("_") %}{{ k }}={{ v }} {% else %}—{% endfor %}
-
-{% endcall %} +
+ {% call tarjeta("Regla", subtitulo=regla.criterio_texto, plano=True) %} +
+
Clave
{{ regla.clave }} · familia {{ regla.familia }}
+
Versión que la produjo
{{ regla.version }} regla_id {{ regla.id }}{% if regla.valid_to %} {{ badge("sustituida", "aviso") }}{% endif %}
+
Tipo de evaluación
{{ regla.tipo_evaluacion }}
+
Parámetros
{% for k, v in (alerta.evidencia.parametros or {}).items() if not k.startswith("_") %}{{ k }}={{ v }} {% else %}—{% endfor %}
+
+ {% endcall %} -{% call tarjeta("Cliente, crédito y transacciones") %} -
- -
Crédito
{% if credito %}{{ credito.id_externo }} · ${{ "{:,.2f}".format(credito.monto) }} · {{ credito.status }}{% else %}—{% endif %}
-
-{% if transacciones %} -{% set columnas = [{"clave": "fecha_pago", "titulo": "Fecha"}, {"clave": "tipo", "titulo": "Tipo"}, {"clave": "metodo", "titulo": "Método"}, {"clave": "titular_origen", "titulo": "Titular origen"}, {"clave": "total", "titulo": "Total", "alinear": "der"}] %} -{% call(fila, col) tabla(columnas, transacciones) %} - {% if col.clave == "fecha_pago" %}{{ fila.fecha_pago.strftime("%d/%m/%Y") }}{% if fila.id == alerta.evidencia.transaccion_id %} {{ badge("dispara", "peligro") }}{% endif %} - {% elif col.clave == "total" %}${{ "{:,.2f}".format(fila.total) }} - {% else %}{{ fila[col.clave] or "—" }}{% endif %} -{% endcall %} -{% endif %} -{% endcall %} - -{% call tarjeta("Evidencia", subtitulo="Los valores que dispararon la regla y el umbral aplicado") %} -
- {% for etiqueta, valor in evidencia %}
{{ etiqueta }}
{{ valor }}
{% endfor %} -
-{% endcall %} - -{% call tarjeta("Gestión", subtitulo="Responsable: " ~ (alerta.responsable or "sin asignar")) %} -{% if puede_mutar %} -
-
- - -
- {% if transicion_disponible.en_revision %} -
- {% endif %} - {% if caso_abierto %} - Ver caso #{{ caso_abierto.id }} - {% elif transicion_disponible.escalada %} - Escalar: abrir caso - {% endif %} - {% if puede_cerrar %} -
- - - -
- {% else %} -

{{ badge("Cerrar requiere rol oficial", "aviso") }} Esta alerta es crítica.

- {% endif %} + {% call tarjeta("Evidencia", subtitulo="Los valores que dispararon la regla y el umbral aplicado", plano=True) %} +
+ {%- for etiqueta, valor in evidencia %}
{{ etiqueta }}
{{ valor }}
{% else %}
Evidencia
—
{% endfor %} +
+ {% endcall %}
-{% elif alerta.estado == "cerrada" %} -

{{ badge("Cerrada", "neutro") }} Sin acciones disponibles.{% if caso_abierto %} Caso #{{ caso_abierto.id }}{% endif %}

-{% elif caso_abierto %} -

{{ badge("En caso", "acento") }} Ver caso #{{ caso_abierto.id }}

-{% else %} -

{{ badge("Solo lectura", "neutro") }} Tu rol ({{ usuario.rol }}) solo consulta.

-{% endif %} + +{% call tarjeta("Cliente, crédito y transacciones", plano=True) %} +
+ +
Crédito
{% if credito %}{{ credito.id_externo }} · ${{ "{:,.2f}".format(credito.monto) }} · {{ credito.status }}{% else %}—{% endif %}
+
+{%- if transacciones %} +
+ + + + {%- for t in transacciones %} + + + + {{ (t.metodo or "—") | capitalize }} + + + + {%- endfor %} + +
FechaTipoMétodoTitular origenTotal
{{ t.fecha_pago.strftime("%d/%m/%Y") }}{% if t.id == alerta.evidencia.transaccion_id %} {{ badge("dispara", "peligro") }}{% endif %}{{ (t.tipo or "—") | capitalize }}{% if t.titular_origen %}{{ badge(t.titular_origen, "peligro" if t.titular_origen == "TERCERO" else ("aviso" if t.titular_origen == "CUENTA" else "neutro")) }}{% else %}—{% endif %}${{ "{:,.2f}".format(t.total) }}
+
+{%- endif %} {% endcall %} -{% call tarjeta("Historial", subtitulo="Reconstruido desde el audit trail") %} -{% set columnas = [{"clave": "fecha", "titulo": "Fecha"}, {"clave": "accion", "titulo": "Acción"}, {"clave": "usuario", "titulo": "Usuario"}, {"clave": "cambio", "titulo": "Cambio"}, {"clave": "motivo", "titulo": "Motivo"}] %} -{% call(fila, col) tabla(columnas, historial, vacio="Sin eventos.") %} - {% if col.clave == "fecha" %}{{ fila.fecha | mx("%d/%m/%Y %H:%M") }} - {% elif col.clave == "cambio" %}{% if fila.antes %}{{ fila.antes.estado or fila.antes.responsable or "" }} → {% endif %}{{ (fila.despues or {}).get("estado") or (fila.despues or {}).get("responsable") or (fila.despues or {}).get("regla") or "" }} - {% else %}{{ fila[col.clave] or "—" }}{% endif %} +{% set acciones %}{% if alerta.responsable %}{{ alerta.responsable }}{% else %}Sin asignar{% endif %}{% endset %} +{% call tarjeta("Gestión", subtitulo="Responsable: " ~ (alerta.responsable or "sin asignar"), acciones=acciones) %} +{%- if puede_mutar %} +
+
+
+ + +
+ {%- if transicion_disponible.en_revision %} +
+ {%- endif %} + {%- if caso_abierto %} + Ver caso #{{ caso_abierto.id }} + {%- elif transicion_disponible.escalada %} + Escalar: abrir caso + {%- endif %} +
+ {%- if puede_cerrar %} +
+ + +
+
+ {%- else %} +

{{ badge("Cerrar requiere rol oficial", "aviso") }}Esta alerta es crítica.

+ {%- endif %} +
+{%- elif alerta.estado == "cerrada" %} +

{{ badge("Cerrada", "neutro") }}Sin acciones disponibles.{% if caso_abierto %} Caso #{{ caso_abierto.id }}{% endif %}

+{%- elif caso_abierto %} +

{{ badge("En caso", "acento") }} Ver caso #{{ caso_abierto.id }}

+{%- else %} +

{{ badge("Solo lectura", "neutro") }}Tu rol ({{ usuario.rol }}) solo consulta.

+{%- endif %} {% endcall %} + +{% call tarjeta("Historial", subtitulo="Reconstruido desde el audit trail", plano=True) %} +
+ + + + {%- for fila in historial %} + + + + + + + + {%- else %} + + {%- endfor %} + +
FechaAcciónUsuarioCambioMotivo
{{ fila.fecha | mx("%d/%m/%Y %H:%M") }}{{ fila.accion or "—" }}{{ fila.usuario or "—" }}{% if fila.antes %}{{ fila.antes.estado or fila.antes.responsable or "" }} → {% endif %}{{ (fila.despues or {}).get("estado") or (fila.despues or {}).get("responsable") or (fila.despues or {}).get("regla") or "" }}{{ fila.motivo or "—" }}
Sin eventos.
+
{% endcall %} {% endblock %} diff --git a/app/templates/casos/detalle.html b/app/templates/casos/detalle.html index 1a7be64..2cb9fbd 100644 --- a/app/templates/casos/detalle.html +++ b/app/templates/casos/detalle.html @@ -1,89 +1,128 @@ {% extends "base.html" %} {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge, badge_nivel_alerta, badge_estado_alerta %} -{% from "_componentes/tabla.html" import tabla %} {% from "_componentes/aviso.html" import aviso as aviso_en_linea %} +{% from "_componentes/iconos.html" import icono %} + +{% set ancho = "amplio" %} {% block titulo %}Caso {{ caso.id }}{% endblock %} {% block contenido %} -
-

← Casos

-

Caso #{{ caso.id }} {{ badge(caso.estado | replace("_", " ") | capitalize, {"abierto": "info", "en_investigacion": "aviso", "escalado": "acento", "cerrado": "neutro"}[caso.estado]) }}

-

Cliente {% if cliente %}{{ cliente.id_externo }}{% else %}—{% endif %} · responsable: {{ caso.responsable or "sin asignar" }} · abierto el {{ caso.created_at | mx("%d/%m/%Y") }}{% if caso.decision %} · decisión: {{ decisiones[caso.decision] }}{% endif %}

-
- +{%- set ESTADOS = {"abierto": "Abierto", "en_investigacion": "En investigación", "escalado": "Escalado", "cerrado": "Cerrado"} %} {% if aviso %}{% endif %} + +
+ +
+
+

Caso de investigación

+

Caso #{{ caso.id }}

+

+ {{ ESTADOS.get(caso.estado, caso.estado) }} + Cliente {% if cliente %}{{ cliente.id_externo }}{% else %}—{% endif %} + ·responsable: {{ caso.responsable or "sin asignar" }} + ·abierto el {{ caso.created_at | mx("%d/%m/%Y") }} + {%- if caso.decision %}·decisión: {{ decisiones[caso.decision] }}{% endif %} +

+
+
+
+ {% if error %}{{ aviso_en_linea(error, tono="peligro") }}{% endif %} {% if caso.fundamento %} -{% call tarjeta("Decisión", subtitulo=decisiones[caso.decision]) %}

{{ caso.fundamento }}

{% endcall %} +{% call tarjeta("Decisión", subtitulo=decisiones[caso.decision]) %}

{{ caso.fundamento }}

{% endcall %} {% endif %} -{% call tarjeta("Alertas vinculadas", subtitulo=alertas | length ~ " alertas") %} -{% set columnas = [{"clave": "id", "titulo": "#"}, {"clave": "regla", "titulo": "Regla"}, {"clave": "nivel", "titulo": "Nivel"}, {"clave": "estado", "titulo": "Estado"}, {"clave": "vence_el", "titulo": "Vence"}] %} -{% call(fila, col) tabla(columnas, alertas) %} - {% set a, r = fila[0], fila[1] %} - {% if col.clave == "id" %}#{{ a.id }} - {% elif col.clave == "regla" %}{{ r.clave }} {{ r.nombre }} · {{ r.version }} - {% elif col.clave == "nivel" %}{{ badge_nivel_alerta(a.nivel) }} - {% elif col.clave == "estado" %}{{ badge_estado_alerta(a.estado) }} - {% else %}{{ a.vence_el.strftime("%d/%m/%Y") if a.vence_el else "—" }}{% endif %} -{% endcall %} +{% call tarjeta("Alertas vinculadas", subtitulo=alertas | length ~ " alertas", plano=True) %} +
+ + + + {%- for a, r in alertas %} + + + + + + + + {%- else %} + + {%- endfor %} + +
#ReglaNivelEstadoVence
#{{ a.id }}{{ r.clave }} {{ r.nombre }} {{ r.version }}{{ badge_nivel_alerta(a.nivel) }}{{ badge_estado_alerta(a.estado) }}{{ a.vence_el.strftime("%d/%m/%Y") if a.vence_el else "—" }}
Sin registros.
+
{% endcall %} -{% call tarjeta("Línea de tiempo", subtitulo="Inmutable: cada hecho es una fila nueva en evento_caso") %} +{% call tarjeta("Línea de tiempo", subtitulo="Inmutable: cada hecho es una fila nueva en evento_caso", plano=True) %}
    - {% for e in eventos %} + {%- for e in eventos %}
  1. -
    {{ e.fecha | mx("%d/%m/%Y %H:%M") }} · {{ badge(e.tipo | replace("_", " ") | capitalize) }} · {{ e.usuario }}
    -

    {{ e.descripcion }}

    - {% if e.adjunto %}

    ⬇ {{ e.adjunto.split("#")[0].split("/")[-1] }} sha256 {{ e.adjunto.split("#sha256=")[-1][:12] }}…

    {% endif %} +
    {{ e.fecha | mx("%d/%m/%Y %H:%M") }}{{ badge(e.tipo | replace("_", " ") | capitalize, "neutro") }}{{ e.usuario }}
    +

    {{ e.descripcion }}

    + {%- if e.adjunto %} +

    {{ icono("evidencia", "icono--14") }}{{ e.adjunto.split("#")[0].split("/")[-1] }}sha256 {{ e.adjunto.split("#sha256=")[-1][:12] }}…

    + {%- endif %}
  2. - {% else %}
  3. Sin eventos.
  4. {% endfor %} + {%- else %}
  5. Sin eventos.
  6. {% endfor %}
{% endcall %} {% if puede_mutar %} -{% call tarjeta("Agregar nota o documento") %} -
- - - - -
-{% endcall %} +
+ {% call tarjeta("Agregar nota o documento", subtitulo="Queda en la línea de tiempo a tu nombre") %} +
+ + + +
+
+ {% endcall %} -{% call tarjeta("Gestión") %} -
-
- - -
- {% if siguiente_estado %} -
- - - -
- {% endif %} - {% if puede_cerrar %} -
- - - -
- {% else %} -

{{ badge("Cerrar requiere rol oficial", "aviso") }}

- {% endif %} + {% call tarjeta("Gestión") %} +
+
+ + +
+ {%- if siguiente_estado %} +
+ + + +
+ {%- endif %} + {%- if puede_cerrar %} +
+
Cerrar caso
+
+ {%- for clave, etiqueta in decisiones.items() %} + + {%- endfor %} +
+
+
0 / 20 mín.
+ +
+
+
+ {%- else %} +

{{ badge("Cerrar requiere rol oficial", "aviso") }}Solo el oficial de cumplimiento decide y cierra el caso.

+ {%- endif %} +
+ {% endcall %}
-{% endcall %} {% elif caso.estado == "cerrado" %} -

{{ badge("Cerrado", "neutro") }} Sin acciones disponibles.

+

{{ badge("Cerrado", "neutro") }}Sin acciones disponibles.

{% else %} -

{{ badge("Solo lectura", "neutro") }} Tu rol ({{ usuario.rol }}) solo consulta y descarga adjuntos.

+

{{ badge("Solo lectura", "neutro") }}Tu rol ({{ usuario.rol }}) solo consulta y descarga adjuntos.

{% endif %} {% endblock %} diff --git a/app/templates/casos/lista.html b/app/templates/casos/lista.html index 07b7d80..0ea8579 100644 --- a/app/templates/casos/lista.html +++ b/app/templates/casos/lista.html @@ -1,49 +1,78 @@ {% extends "base.html" %} {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge %} -{% from "_componentes/tabla.html" import tabla %} +{% from "_componentes/iconos.html" import icono %} +{% from "_componentes/paginacion.html" import paginacion %} +{% from "_componentes/pestanas.html" import pestanas %} + +{% set ancho = "amplio" %} {% block titulo %}Casos{% endblock %} {% block contenido %} +{%- set ESTADOS = {"abierto": "Abierto", "en_investigacion": "En investigación", "escalado": "Escalado", "cerrado": "Cerrado"} %} +{%- macro url() -%} +{%- set parametros = {"estado": filtros.estado, "responsable": filtros.responsable, "cliente_id": filtros.cliente_id} %}{% set _ = parametros.update(kwargs) -%} +{%- set consulta = parametros | dictsort | rejectattr(1, "none") | selectattr(1) | list | urlencode -%} +/casos{{ "?" ~ consulta if consulta }} +{%- endmacro %} +
-

Casos

-

{{ conteos.total }} casos · {{ conteos.por_estado.abierto + conteos.por_estado.en_investigacion + conteos.por_estado.escalado }} abiertos · bandeja de alertas

+
+

Paso 06 del recorrido

+

Alertas y casos

+

{{ conteos.total }} casos · {{ conteos.por_estado.abierto + conteos.por_estado.en_investigacion + conteos.por_estado.escalado }} abiertos · un caso se abre desde una alerta.

+
+{{ pestanas([("alertas", "Alertas", "/alertas"), ("casos", "Casos", "/casos")], "casos", etiqueta="Alertas y casos") }} -
- {{ conteos.total }}Casos - {% for e in estados %}{{ conteos.por_estado[e] }}{{ e | replace("_", " ") | capitalize }}{% endfor %} -
+
+ Casos{{ conteos.total }} + {%- for e in estados %} + {{ ESTADOS.get(e, e) }}{{ conteos.por_estado[e] }} + {%- endfor %} +
-{% call tarjeta("Filtros") %} -
+{%- set activos = [filtros.estado, filtros.responsable, filtros.cliente_id] | select | list | length %} +{% set acciones %} + {%- if activos %}{{ activos }} filtro{{ "s" if activos != 1 }}{% endif -%} + Limpiar filtros +{% endset %} +{% call tarjeta("Casos", subtitulo=conteos.filtrados ~ " casos · página " ~ pagina ~ " de " ~ paginas, acciones=acciones, plano=True) %} + - {% if filtros.cliente_id %}{% endif %} - - Limpiar + {%- if filtros.cliente_id %}{% endif %} +
-{% if filtros.cliente_id %}

{{ badge("Cliente " ~ filtros.cliente_id, "info") }} ver ficha

{% endif %} -{% endcall %} - -{% call tarjeta("Casos", subtitulo=conteos.filtrados ~ " casos · página " ~ pagina ~ " de " ~ paginas) %} -{% set columnas = [{"clave": "id", "titulo": "#"}, {"clave": "cliente", "titulo": "Cliente"}, {"clave": "claves", "titulo": "Alertas"}, {"clave": "estado", "titulo": "Estado"}, {"clave": "responsable", "titulo": "Responsable"}, {"clave": "decision", "titulo": "Decisión"}, {"clave": "created_at", "titulo": "Abierto"}] %} -{% call(fila, col) tabla(columnas, filas, vacio="Ningún caso cumple los filtros.") %} - {% if col.clave == "id" %}{{ fila.id }} - {% elif col.clave == "cliente" %}{% if fila.cliente_id %}{{ fila.cliente }}{% else %}—{% endif %} - {% elif col.clave == "claves" %}{{ fila.alertas }} · {{ fila.claves | join(", ") }} - {% elif col.clave == "estado" %}{{ badge(fila.estado | replace("_", " ") | capitalize, {"abierto": "info", "en_investigacion": "aviso", "escalado": "acento", "cerrado": "neutro"}[fila.estado]) }} - {% elif col.clave == "created_at" %}{{ fila.created_at | mx("%d/%m/%Y") }} - {% elif col.clave == "decision" %}{{ fila.decision | replace("_", " ") | capitalize if fila.decision else "—" }} - {% else %}{{ fila[col.clave] or "—" }}{% endif %} -{% endcall %} -{% if paginas > 1 %}{% endif %} +{%- if filtros.cliente_id %}

{{ badge("Cliente " ~ filtros.cliente_id, "info") }} ver ficha · todos los casos

{% endif %} +
+ + + + {%- for fila in filas %} + + + + + + + + + + + {%- else %} + + {%- endfor %} + +
#ClienteAlertasEstadoResponsableDecisiónAbiertoAbrir
Caso #{{ fila.id }}{% if fila.cliente_id %}{{ fila.cliente }}{% else %}—{% endif %}{{ fila.alertas }} · {{ fila.claves | join(", ") }}{{ ESTADOS.get(fila.estado, fila.estado) }}{{ fila.responsable or "—" }}{{ fila.decision | replace("_", " ") | capitalize if fila.decision else "—" }}{{ fila.created_at | mx("%d/%m/%Y") }}{{ icono("chevron") }}
Ningún caso cumple los filtros.
+
+{{ paginacion(pagina, paginas, url() ~ ("&" if "?" in url() else "?") ~ "pagina=", total=conteos.filtrados, por_pagina=filtros.por_pagina) }} {% endcall %} {% endblock %} diff --git a/app/templates/casos/nuevo.html b/app/templates/casos/nuevo.html index 7765296..64b1266 100644 --- a/app/templates/casos/nuevo.html +++ b/app/templates/casos/nuevo.html @@ -2,28 +2,55 @@ {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge_nivel_alerta, badge_estado_alerta %} {% from "_componentes/aviso.html" import aviso as aviso_en_linea %} +{% from "_componentes/iconos.html" import icono %} {% block titulo %}Nuevo caso{% endblock %} {% block contenido %} -
-

← Alerta #{{ alerta.id }}

-

Abrir caso para {{ cliente.id_externo }}

-

Las alertas elegidas pasan a escalada y quedan vinculadas al caso. Solo alertas abiertas del mismo cliente que no estén ya en otro caso.

-
+
+ +
+
+

Escalar a un caso

+

Abrir caso para {{ cliente.id_externo }}

+

Las alertas elegidas pasan a escalada y quedan vinculadas al caso. Solo alertas abiertas del mismo cliente que no estén ya en otro caso.

+
+
+
{% if error %}{{ aviso_en_linea(error, tono="peligro") }}{% endif %} -{% call tarjeta("Alertas a incluir") %} -
-
    - {% for a, r in candidatas %} -
  • - {% endfor %} -
- - - + + {% call tarjeta("Alertas a incluir", subtitulo=candidatas | length ~ " alertas abiertas del cliente", plano=True) %} +
+ + + + {%- for a, r in candidatas %} + + + + + + + + {%- else %} + + {%- endfor %} + +
Incluir#ReglaNivelEstado
{{ badge_nivel_alerta(a.nivel) }}{{ badge_estado_alerta(a.estado) }}
Sin alertas abiertas disponibles.
+
+ {% endcall %} + + {% call tarjeta("Apertura") %} +
+ + +
+ Cancelar + +
+
+ {% endcall %}
-{% endcall %} {% endblock %}