{% extends "nbapp_base.html" %} {% block content %} {% set urls = { 'enviar': url_for('main.notificaciones_enviar'),} %}
nro: {{ nro }} - fecha: {{ fecha }} - estilo: {{ estilo }}
{% for d in data %}

Notificación #{{ loop.index }}

Cliente {{ d.cliente }}
{% if (d.propietarios or []) | length > 1 %} Solicitantes | Propietarios {% elif (d.propietarios or []) | length == 1 %} Solicitante | Propietario {% endif %} {% for p in d.propietarios %} {% if (d.propietarios or []) | length > 1 %} {{ loop.index }}. {{ p.nombre }} {% else %} {{ p.nombre }} {% endif %} {% endfor %}
Email
{% for url in d.pdf_url %} {% endfor %}

{{ d.rendered_html | safe }}
{% if d.marcas and d.marcas | length > 0 %}
{{ 'Marca' if d.marcas | length == 1 else 'Marcas' }} ({{ d.marcas | length }}) {% for marca in d.marcas %}
Marca {{ loop.index }}
{% for key, value in marca | dictsort %} {% if value and value | trim != '' %} {% set value_str = value|string %}
{% if value_str.startswith('https://') and (value_str.endswith('.jpg') or value_str.endswith('.png')) %} {{ key | replace('_', ' ') }}:
{{ key }} {% else %} {{ key | replace('_', ' ') }}: {{ value }} {% endif %}
{% endif %} {% endfor %}
{% endfor %}
{% endif %} {% if d.facturas and d.facturas | length > 0 %}
{{ 'Factura' if d.facturas | length == 1 else 'Facturas' }} ({{ d.facturas | length }}) {% for f in d.facturas %} {% set dias = f.get('dias_vencido') %} {% set dias_int = dias if dias is number else 0 %}
Factura {{ loop.index }}  No.: {{ f.nro }}  Fecha: {{ f.fecha }}
Estado: {{ f.estado }} {% if dias_int > 0 %} ({{ dias_int }} días) {% endif %}
Cliente: {{ f.cliente }}
Resumen: {{ f.resumen }}
{% endfor %}
{% endif %} {% if d.pdf_url and d.pdf_url | length > 0 %}
{{ 'Attachment' if d.pdf_url | length == 1 else 'Attachments' }} ({{ d.pdf_url | length }})
{% for url in d.pdf_url %} {{ url }} {% endfor %}
{% endif %}
JSON
            {{ d | tojson(indent=2) | safe  }}
        
HTML
            {{ d.rendered_html }}
        
{% endfor %} {% endblock %}