{% extends 'layout.html' %} {% from 'macros.html' import common_styles, info_row %} {% block title %}{{ utilisateur.username }}{% endblock %} {% block page_title %}Fiche utilisateur{% endblock %} {% block styles %}{{ common_styles() }} {% endblock %} {% block content %} {% set notif_config = {} %} {% if utilisateur.notif_config %} {# Parser côté Python via le contexte #} {% endif %}
Retour
{{ utilisateur.username }}
{% if utilisateur.connect == 'oui' %} ● Actif {% else %} ● Inactif {% endif %}
Modifier {% if utilisateur.id != session.user_id %} Supprimer {% endif %}
{{ utilisateur.username[0]|upper }}
{{ utilisateur.username }}
{{ utilisateur.type }}
{{ info_row('ID', '#' ~ utilisateur.id, 'fa-hashtag') }} {{ info_row("Nom d'utilisateur", utilisateur.username, 'fa-user') }} {{ info_row('Rôle', utilisateur.type, 'fa-shield-alt') }}
Statut
{% if utilisateur.connect == 'oui' %} ✅ Actif {% else %} ❌ Inactif {% endif %}
Notifications configurées Modifier
{% set nc = utilisateur.notif_config_parsed if utilisateur.notif_config_parsed else {} %} {% set notifs = [ ('nouvelle_intervention', 'fa-clipboard-list', '#eff6ff', '#2563eb', 'Nouvelle intervention'), ('intervention_urgente', 'fa-bolt', '#fef3c7', '#d97706', 'Intervention très urgente'), ('intervention_traitee', 'fa-check-circle', '#d1fae5', '#059669', 'Intervention traitée'), ('stock_alerte', 'fa-exclamation-triangle','#fee2e2','#dc2626','Alerte stock pièces'), ('maintenance_preventive','fa-calendar-check', '#ede9fe', '#7c3aed', 'Maintenance préventive'), ('ordre_travail', 'fa-tools', '#f0fdf4', '#16a34a', 'Ordre de travail'), ] %} {% for key, icon, bg, color, title in notifs %} {% set active = nc.get(key, '1' if key in ['nouvelle_intervention','intervention_urgente'] else '0') == '1' %}
{{ title }}
{% if active %} Activée {% else %} Désactivée {% endif %}
{% endfor %}
{% endblock %}