fix: show user nav (not admin nav) when impersonating a user

When viewed_user is set, the sidebar should render the full user
navigation (connections, catalog, sync, profile) instead of the
admin-only panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-05-24 17:54:28 +03:00
parent 0c71497522
commit 403d8bce4d

View File

@@ -35,13 +35,13 @@
<nav class="sb-nav"> <nav class="sb-nav">
{% if user %} {% if user %}
{% if user.role in ('admin', 'system') %} {% if user.role in ('admin', 'system') and not viewed_user %}
<div class="sb-section">Управление</div> <div class="sb-section">Управление</div>
<a href="/admin/users" class="sb-item {% if request.url.path.startswith('/admin/users') %}active{% endif %}"> <a href="/admin/users" class="sb-item {% if request.url.path.startswith('/admin/users') %}active{% endif %}">
<span class="sb-icon"><i class="bi bi-people"></i></span> <span class="sb-icon"><i class="bi bi-people"></i></span>
<span>Пользователи</span> <span>Пользователи</span>
</a> </a>
{% if user.role == 'system' %} {% if user.role in ('admin', 'system') %}
<a href="/admin/logs" class="sb-item {% if request.url.path.startswith('/admin/logs') %}active{% endif %}"> <a href="/admin/logs" class="sb-item {% if request.url.path.startswith('/admin/logs') %}active{% endif %}">
<span class="sb-icon"><i class="bi bi-journal-text"></i></span> <span class="sb-icon"><i class="bi bi-journal-text"></i></span>
<span>Логи</span> <span>Логи</span>