{% load static i18n user_admin_tags %} {% with ns=request.resolver_match.namespace url_name=request.resolver_match.url_name %}
{# ── Brand ──────────────────────────────────── #} {# ── Desktop Navigation ──────────────────────── #} {# ── Utilities (right side) ──────────────────── #}
{% if user.is_authenticated %} {% include "notifications/partials/badge.html" with unread_count=nav_unread_notifications|default:0 %} {# User menu #}
{# Trigger #} {# Panel #}
{# Identity card header — warm cream tint #}
{% include "components/user_avatar.html" with user=request.user size="lg" variant="on_dark" only %}

{{ request.user.get_full_name|default:request.user.email }}

{% if request.user.is_superuser %}Superuser {% elif request.user.role %}{{ request.user.get_role_display }} {% elif request.user.is_staff %}Staff {% else %}Member{% endif %}
{# Account #} {% comment %} WS5.12 — Language switcher, disabled for now (English is the default; re-enable once FR/AR/PT translations are ready). POSTs to Django's set_language so the choice persists in the user's session. {% endcomment %} {% comment %} {% get_current_language as CURRENT_LANG %}

{% translate "Language" %}

{% for lang_code, lang_name in LANGUAGES %}
{% csrf_token %}
{% endfor %}
{% endcomment %} {# Admin panel — staff only #} {% if user.is_staff or perms.core.manage_users %}
{% if user.is_staff or perms.core.manage_users %} {# WS5.3 — staff user management. Gated on manage_users perm. #} {% pending_user_review_count as PENDING_USERS %} {% translate "Manage users" %} {% if PENDING_USERS %} {{ PENDING_USERS }} {% endif %} {% endif %} {% if user.is_staff %} {% translate "Notification templates" %} {% translate "Django admin" %} {% endif %}
{% endif %} {# Sign out #}
{% else %} Sign in {% endif %} {# Mobile hamburger — authenticated only #} {% if user.is_authenticated %} {% endif %}
{# ── Mobile Menu Panel ───────────────────────────────────── #}
{% endwith %}