{# Composant réutilisable pour afficher une notification Variables: - notification: objet NotificationApp - compact: bool (mode compact pour dropdown) - défaut: false - show_actions: bool (afficher les boutons d'action) - défaut: true - show_user: bool (afficher l'utilisateur) - défaut: false (admin uniquement) #} {% set compact = compact|default(false) %} {% set show_actions = show_actions|default(true) %} {% set show_user = show_user|default(false) %} {% set color = notification|notification_color %} {% set icon = notification|notification_icon %} {# Classes de couleur selon la catégorie #} {% set bg_colors = { 'blue': 'bg-blue-100 dark:bg-blue-900/30', 'green': 'bg-green-100 dark:bg-green-900/30', 'yellow': 'bg-yellow-100 dark:bg-yellow-900/30', 'red': 'bg-red-100 dark:bg-red-900/30' } %} {% set text_colors = { 'blue': 'text-blue-800 dark:text-blue-400', 'green': 'text-green-800 dark:text-green-400', 'yellow': 'text-yellow-800 dark:text-yellow-400', 'red': 'text-red-800 dark:text-red-400' } %} {% set border_colors = { 'blue': 'border-blue-300 dark:border-blue-700', 'green': 'border-green-300 dark:border-green-700', 'yellow': 'border-yellow-300 dark:border-yellow-700', 'red': 'border-red-300 dark:border-red-700' } %}
{{ notification.user.fullName }} ({{ notification.user.email }})
{% endif %}{{ notification.message }}
{# Footer (date + actions) #}