{% extends "base.html" %} {% block title %}{{ ltext('Edit User / تعديل مستخدم') if user else ltext('Create User / إنشاء مستخدم') }} | {{ app_name }}{% endblock %} {% block content %}

{{ ltext('Edit User / تعديل مستخدم') if user else ltext('Create User / إنشاء مستخدم') }}

{{ ltext('Assign roles, company scope, department scope, and account restrictions. / وزّع الأدوار وحدود الشركات والأقسام وسياسات الحساب.') }}

{{ ltext('For display titles, use English / العربية in the same field so the shown text follows the selected language. / للعناوين الظاهرة، استخدم English / العربية داخل نفس الحقل ليتبدل النص المعروض مع اللغة المختارة.') }}
{{ form.hidden_tag() }} {% if can_manage_mfa %} {% endif %}
{{ form.submit(class="button") }}
{% if user %}

{{ ltext('Telegram Link / ربط تيليجرام') }}

{{ ltext('Use this section if you are preparing the Telegram link for the user from the admin side. The user must still open the bot from their own Telegram account and share the same mobile number. / استخدم هذا القسم إذا كنت تجهز رابط تيليجرام للمستخدم من جهة الإدارة. لكن يجب أن يفتح المستخدم البوت من حسابه في تيليجرام ويشارك نفس رقم الموبايل.') }}

{% if user.telegram_chat_id %} {% elif active_telegram_link %} {% else %} {% endif %}
{% if telegram_enabled and user.phone and not user.telegram_chat_id %}
{% endif %}
{% if generated_telegram_link %} {% endif %}
{% if not telegram_enabled %} {{ ltext('Telegram notifications are disabled or not configured in system settings. / إشعارات تيليجرام معطلة أو غير مضبوطة في إعدادات النظام.') }} {% elif not user.phone %} {{ ltext('Save the user mobile number first. It must match the number they will share from Telegram. / احفظ رقم موبايل المستخدم أولاً. يجب أن يطابق الرقم الذي سيشاركه من تيليجرام.') }} {% elif telegram_bot_username %} {{ ltext('Bot username / اسم مستخدم البوت') }}: @{{ telegram_bot_username }} {% endif %}
{% endif %} {% endblock %}