{% extends "base.html" %} {% block content %}

System Users

Manage all users in the system.

New User
Total Users

{{ users|length }}

Active

{{ users|selectattr('is_active')|list|length }}

Inactive

{{ users|rejectattr('is_active')|list|length }}

Admins

{{ users|selectattr('role', 'equalto', 'Admin')|list|length }}

{% if search or role_filter or status_filter or department_filter %}
Active Filters Clear All {% if search %} Search: "{{ search }}" {% endif %} {% if role_filter %} Role: {{ role_filter }} {% endif %} {% if department_filter %} Department: {{ departments|selectattr('id', 'equalto', department_filter|int)|map(attribute='name')|join }} {% endif %} {% if status_filter %} Status: {{ status_filter }} {% endif %}
{% endif %}
User List {{ users|length }} Users
{% for user in users %} {% else %} {% endfor %}
ID Username Full Name Email Role Department Head Status Actions
{{ user.id }} {{ user.username }} {{ user.full_name or "-" }} {{ user.email }} {{ user.role }} {% if user.department %} {{ user.department.name if user.department is not string else user.department }} {% else %} None {% endif %} {% if user.is_department_head %} Head {% else %} {% endif %} {% if user.is_active %} Active {% else %} Inactive {% endif %} {% if current_user.role == "Admin" and user.id != current_user.id %} {% if user.is_active %} {% else %} {% endif %} {% endif %} {% if current_user.role == "Admin" and user.id != current_user.id %} {% endif %}
No users found matching your filters.
{% endblock %}