{% include "header.html" %}
{% if user and (user.role == 'docente' or user.role == 'admin') %}

Enviar notificación

Crea un aviso para un alumno. Se guardará y aparecerá en su bandeja.

{% if view_user %}
Enviando a {{ view_user.name }}
{% endif %}
{% if not view_user %}
{% endif %}
{% if view_user and appointments and appointments|length > 0 %}

Si eliges una reserva, la nota quedará vinculada a esa clase.

{% endif %}
{% endif %}

{% if view_user %}Bandeja de {{ view_user.name }}{% else %}Tus notificaciones{% endif %}

{% if notifications and notifications|length > 0 %} {{ notifications|length }} {% endif %}
{% if notifications and notifications|length > 0 %}
{% for n in notifications %}

{{ n.title }}

{% if n.reservation_id and appointments_map and appointments_map.get(n.reservation_id) %} {% set ap = appointments_map.get(n.reservation_id) %}
Clase: {{ ap.date }} {{ ap.time }}
{% endif %}
{{ n.created_at }} {{ n.sender_name or 'Sistema' }}
{{ n.body }}
{% if user and (user.role not in ('docente','admin')) and not view_user %} {% endif %}
{% if view_user %} {% endif %}
{% endfor %}
{% else %}

No hay notificaciones

{% if view_user %}Este alumno no tiene notificaciones por ahora.{% else %}No tienes notificaciones pendientes.{% endif %}

{% endif %}
{% if user and (user.role == 'docente' or user.role == 'admin') and sent_notifications and sent_notifications|length > 0 %}

Notificaciones Enviadas

Historial de notificaciones que has enviado a los alumnos

{% for n in sent_notifications %}

{{ n.title }}

{% if n.reservation_id and appointments_map and appointments_map.get(n.reservation_id) %} {% set ap = appointments_map.get(n.reservation_id) %}
{{ ap.date }} {{ ap.time }}
{% endif %}
{{ n.created_at }}
Para: {{ n.recipient_name or 'Alumno' }}
{{ n.body }}
{% if view_user %} {% endif %}
{% endfor %}
{% endif %}
{% include "footer.html" %}