{% extends 'layouts/authenticated.html.twig' %} {% block page_title %}{{ page_title }}{% endblock %} {% block content %} {# Header avec titre et bouton broadcast #}

Tableau de Bord des Notifications

Vue d'ensemble et statistiques du système de notifications

{# Statistiques globales (4 cartes) #}
{# Total #}
Total Notifications
{{ stats.total }}
{# Non lues #}
Non Lues
{{ stats.unread }}
{# Lues #}
Lues
{{ stats.read }}
{# Par type (la plus fréquente) #}
Type Principal
{% if stats.by_type is not empty %} {# Trouver le type avec le plus de notifications #} {% set max_type = '' %} {% set max_count = 0 %} {% for type, count in stats.by_type %} {% if count > max_count %} {% set max_type = type %} {% set max_count = count %} {% endif %} {% endfor %} {{ max_type|capitalize }} {% else %} Aucun {% endif %}
{% if stats.by_type is not empty %} {% set max_count = 0 %} {% for type, count in stats.by_type %} {% if count > max_count %} {% set max_count = count %} {% endif %} {% endfor %} {{ max_count }} notification{{ max_count > 1 ? 's' : '' }} {% else %} Aucune donnée {% endif %}
{# Graphique 7 derniers jours + Top utilisateurs #}
{# Statistiques 7 derniers jours #}

Notifications des 7 derniers jours

{% if last_7_days_stats is empty %}

Aucune donnée disponible

{% else %} {# Calculer le maximum pour la barre de progression #} {% set max_count = 1 %} {% for count in last_7_days_stats %} {% if count > max_count %} {% set max_count = count %} {% endif %} {% endfor %}
{% for date, count in last_7_days_stats %}
{{ date|date('d/m/Y') }} {{ count }} notification{{ count > 1 ? 's' : '' }}
{% set percentage = max_count > 0 ? (count / max_count * 100) : 0 %}
{% endfor %}
{% endif %}
{# Top 10 utilisateurs #}

Top 10 utilisateurs

{% if top_users is empty %}

Aucune donnée disponible

{% else %}
{% for user_stat in top_users %}
{{ user_stat.email|slice(0, 2)|upper }}

{% if user_stat.firstName or user_stat.lastName %} {{ user_stat.firstName }} {{ user_stat.lastName }} {% else %} {{ user_stat.email }} {% endif %}

{{ user_stat.email }}

{{ user_stat.notificationCount }}
{% endfor %}
{% endif %}
{# Notifications récentes #}

Notifications Récentes

{% if recent_notifications is empty %}

Aucune notification récente

Les notifications apparaîtront ici.

{% else %} {# Desktop #} {# Mobile #}
{% for notification in recent_notifications %} {% include 'components/_notification_item.html.twig' with { notification: notification, compact: true, show_actions: false, show_user: true } %} {% endfor %}
Voir toutes les notifications
{% endif %}
{% endblock %}