{% extends "base.html" %} {% block title %}Tableau de bord — GMAO Collège{% endblock %} {% block extra_head %} {% endblock %} {% block content %}

Tableau de bord

Interventions

{{ stats.interventions_total }}

{{ stats.interventions_en_cours }} en cours
Curatif / Préventif

{{ stats.interventions_curatif }} / {{ stats.interventions_preventif }}

{{ stats.interventions_recurrentes }} récurrentes
Équipements

{{ stats.equipments_total }}

{{ stats.equipments_hors_service }} hors service
Stock bas

{{ stats.parts_low_stock }}

pièce(s)

{{ stats.preventif_overdue }}

En retard

{{ stats.preventif_this_week }}

Cette semaine

{{ stats.preventif_this_month }}

Ce mois

{{ stats.interventions_recurrentes }}

Récurrentes
{% if alerts %}
Alertes récentes
{% for alert in alerts[:5] %}
{{ alert.message[:100] }}{% if alert.message|length > 100 %}…{% endif %}
{% endfor %} {% if alerts|length > 5 %} Voir tout ({{ alerts|length }}) {% endif %}
{% endif %} {% if day_schedule and day_schedule.items %}
Maintenances du jour {{ day_schedule.items|length }}
{% for item in day_schedule.items %} {% endfor %}
Heure Type Description Salle Durée
{% if item.start_time %} {{ item.start_time.strftime('%H:%M') if item.start_time.strftime else item.start_time }} {% else %} — {% endif %} {% if item.type == 'admin' %} Admin {% elif item.type == 'curative' %} Curative {% elif item.type == 'preventive' %} Préventive {% elif item.type == 'formation' %} Formation {% else %} {{ item.type }} {% endif %} {{ item.title }} {% if item.room_name %} {{ item.room_name }} {% else %} — {% endif %} {% if item.duration %} {{ item.duration }} min {% else %} — {% endif %}
{% elif day_schedule and day_schedule.is_working %}
Maintenances du jour

Aucune maintenance planifiée pour aujourd'hui.

{% if day_schedule.working_hours %} Horaires: {{ day_schedule.working_hours.start.strftime('%H:%M') }} - {{ day_schedule.working_hours.end.strftime('%H:%M') }} {% endif %}
{% elif day_schedule and day_schedule.closure %}
{{ day_schedule.closure }}

Jour non travaillé

{% elif day_schedule and day_schedule.leave %}
Congé

{{ day_schedule.leave }}

{% endif %}
Maintenances à venir
{% if upcoming_maintenances %}
{% for interv in upcoming_maintenances[:10] %} {% set days_until = (interv.next_due_date - now).days %}
{{ interv.title }} {{ interv.equipment.name }} {% if interv.frequency_days %} · {{ frequency_labels.get(interv.frequency_days, interv.frequency_days ~ "j") }} {% endif %}
{% if days_until < 0 %} En retard {% elif days_until < 7 %} ~{{ days_until }}j {% else %} ~{{ days_until }}j {% endif %}
{% endfor %}
{% if upcoming_maintenances|length > 10 %} {% endif %} {% else %}
Aucune maintenance à venir.
{% endif %}
Répartition par fréquence
{% if frequency_data %} {% for item in frequency_data %}
{{ item.label }}
{% set max_count = frequency_data|map(attribute='count')|max %} {% set pct = (item.count / max_count * 100)|int if max_count > 0 else 0 %}
{{ item.count }}
{% endfor %} {% else %}

Aucune donnée.

{% endif %}
Workflow en attente
{% if workflow_pending_data %} {% for item in workflow_pending_data %}
{{ item.label }}
{{ item.count }}
{% endfor %} {% else %}

Rien en attente.

{% endif %}
Activité récente
{% if recent_status_changes %}
{% for change in recent_status_changes[:8] %}
{{ change.changed_by.full_name if change.changed_by else '?' }} · #{{ change.intervention_id }}
{{ change.from_label }} {{ change.to_label }}
{{ change.created_at|datetime_fmt }}
{% endfor %}
{% else %}
Aucun changement récent.
{% endif %}
Interventions par mois
Interventions par statut
Equipements par statut
Top 5 equipements
Dernières interventions Nouvelle
{% if recent_interventions %}
{% for interv in recent_interventions %} {% endfor %}
#TitreTypeStatutÉquipement
#{{ interv.id }} {{ interv.title[:50] }}{% if interv.title|length > 50 %}…{% endif %} {% if interv.type == 'curatif' %}Curatif {% else %}Préventif{% endif %} {{ interv.status|format_status }} {{ interv.equipment.name[:30] }}{% if interv.equipment.name|length > 30 %}…{% endif %}
{% else %}
Aucune intervention.
{% endif %}
{% if pending_interpretations %}
Interprétations en attente {{ pending_interpretations|length }} Voir tous
{% for interp in pending_interpretations %} {% endfor %}
SourceTypeExpéditeurSujetDateActions
{% if interp.source == 'ENT' %} ENT {% else %} Outlook {% endif %} {% if interp.type == 'curative' %} Curative {% elif interp.type == 'preventive' %} Préventive {% elif interp.type == 'administrative' %} Admin {% elif interp.type == 'formation' %} Formation {% elif interp.type == 'information' %} Information {% else %} {{ interp.type or 'N/A' }} {% endif %} {{ interp.sender[:20] }}{% if interp.sender|length > 20 %}…{% endif %} {{ (interp.subject or 'Sans sujet')[:30] }}{% if interp.subject and interp.subject|length > 30 %}…{% endif %} {{ interp.date.strftime('%d/%m %H:%M') if interp.date else '-' }}
{% endif %} {% endblock %}