{% extends 'backoffice/base.html' %} {% load static %} {% block title %}{{ page_title }} - ECOLUX Dashboard{% endblock %} {% block content %}

{{ page_title }}

{% if user_type == 'DRH' %}

{{ total_projects }}

Projets Total

{{ active_projects }}

Projets Actifs

{{ total_activities }}

Activités Total

{{ pending_activities }}

En Attente

Projets Récents

{% if recent_projects %} {% for project in recent_projects %}

{{ project.title }} {{ project.get_status_display }}
Client: {{ project.client.user.get_full_name }} {{ project.created_at|timesince }} ago

{% endfor %} {% else %}

Aucun projet récent

{% endif %}

Activités Récentes

{% if recent_activities %} {% for activity in recent_activities %}

{{ activity.title }} {{ activity.get_activity_type_display }}
{{ activity.project.title }} {{ activity.created_at|timesince }} ago {% if activity.assigned_users.exists %}

{% for assigned_user in activity.assigned_users.all|slice:":3" %} {{ assigned_user.user.get_full_name|default:assigned_user.user.username }} {% endfor %} {% if activity.assigned_users.count > 3 %} +{{ activity.assigned_users.count|add:"-3" }} {% endif %}
{% elif activity.assigned_to %}
{{ activity.assigned_to.user.get_full_name|default:activity.assigned_to.user.username }} {% endif %}

{% endfor %} {% else %}

Aucune activité récente

{% endif %}
{% elif user_type == 'CLIENT' %}

{{ my_projects_count }}

Mes Projets

{{ my_active_projects }}

En Cours

{{ my_activities.count }}

Activités

Mes Projets

{% if my_projects %} {% for project in my_projects %}

{{ project.title }} {{ project.get_status_display }}
{{ project.activities_count }} activités Progression: {{ project.completion_percentage }}%

{{ project.completion_percentage }}%
{% endfor %} {% else %}

Aucun projet en cours

{% endif %}
{% elif user_type == 'TECHNICIEN' %}

Mes Notes

{% if my_notes %} {% for note in my_notes %}

{{ note.title }} {% if note.is_completed %} Terminé {% else %} En cours {% endif %}
Projet: {{ note.project.title }} {% if note.due_date %} Échéance: {{ note.due_date }} {% endif %}

{% endfor %} {% else %}

Aucune note assignée

{% endif %}

Projets Assignés

{% if assigned_projects %} {% for project in assigned_projects %}

{{ project.title }} {{ project.get_status_display }}
Client: {{ project.client.user.get_full_name }}

{% endfor %} {% else %}

Aucun projet assigné

{% endif %}
{% endif %}
{% endblock %}