{% extends "base.html" %} {% block title %}{{ ltext('Users / المستخدمون') }} | {{ app_name }}{% endblock %} {% block content %}

{{ ltext('Users / المستخدمون') }}

{{ ltext('Manage internal staff, external accounts, department access, Telegram routing, and security posture. / إدارة المستخدمين والوصول للأقسام وربط تلغرام وحالة الحماية.') }}

{% if can_manage_mfa %}
{% endif %} {{ ltext('Export Excel / تصدير Excel') }} {{ ltext('New User / مستخدم جديد') }}
{% for user in users.items %} {% else %} {% endfor %}
{{ ltext('Name / الاسم') }} {{ ltext('Email / البريد') }} {{ ltext('Mobile / الموبايل') }} {{ ltext('Type / النوع') }} {{ ltext('Company / الشركة') }} {{ ltext('Department / القسم') }} {{ ltext('Status / الحالة') }}
{{ user.full_name }} {% if user.telegram_chat_id %}
{{ ltext('Telegram Linked / تلغرام مربوط') }} {% endif %}
{{ user.email }} {{ user.phone or '-' }} {{ user.user_type.value|ltext }} {{ user.company.name if user.company else t('internal') }} {{ user.department.name if user.department else t('unassigned') }} {% if user.allowed_departments %}
{% for department in user.allowed_departments %} {{ department.name }}{% if not loop.last %}, {% endif %} {% endfor %} {% endif %}
{% if user.is_enabled %} {{ t('active') }} {% else %} {{ 'Disabled'|ltext }} {% endif %} {% if user.is_currently_locked %} / {{ t('locked') }}{% endif %}
{{ ltext('Email OTP MFA Enabled / تفعيل MFA عبر البريد') if user.two_factor_enabled else ltext('Email OTP MFA Disabled / تعطيل MFA عبر البريد') }}
{{ t('edit') }}
{% if user.is_currently_locked %}
{% else %}
{% endif %} {% if can_manage_mfa %}
{% endif %}
{{ ltext('No users found. / لا يوجد مستخدمون.') }}
{% set pagination = users %} {% include "partials/pagination.html" %}
{% endblock %}