Restore floating top menu and hide sidebar for non-system-admin users

This commit is contained in:
A R R R Associates
2026-07-06 13:40:58 +05:30
parent 0bcb87e818
commit ef2c5b9bea
+15 -17
View File
@@ -100,11 +100,16 @@
{% set current_branch_name = firm_branding.branch_name if firm_branding else "" %}
{% set domain_context = get_domain_context(request) %}
{% set is_system_admin_user = full_auth and ("System Admin" in ui_roles) %}
{% set show_legacy_sidebar = full_auth and is_system_admin_user %}
{% set can_manage_local_storage_agent = full_auth and can_view_documents(current_user, ui_perms, ui_roles) and can_upload_documents(current_user, ui_perms, ui_roles) and (ui_roles|select("in", ["Firm Admin", "Partner", "Branch Manager"])|list|length > 0) %}
{# Navigation UI Cleanup V2.1
Sidebar is retained only for System Admin users.
All other authenticated users use the floating top workspace bar on every page.
Existing routes and old sidebar code are kept intact. #}
{% set use_clean_top_nav = full_auth and not is_system_admin_user %}
<div class="min-h-screen {% if show_legacy_sidebar %}lg:grid lg:grid-cols-[260px_minmax(0,1fr)]{% endif %}">
{% if show_legacy_sidebar %}
<div class="min-h-screen {% if not use_clean_top_nav %}lg:grid lg:grid-cols-[260px_minmax(0,1fr)]{% endif %}">
{% if not use_clean_top_nav %}
<aside class="border-b border-slate-200 bg-slate-900 text-slate-100 lg:min-h-screen lg:border-b-0 lg:border-r lg:border-slate-800">
<div class="flex items-center gap-3 px-5 py-5">
{% if firm_branding.logo_url %}<img src="{{ firm_branding.logo_url }}" alt="{{ current_firm_name }} logo" class="h-11 w-11 rounded-2xl bg-white object-contain p-1 shadow-soft" />{% else %}<div class="flex h-11 w-11 items-center justify-center rounded-2xl bg-brand-500 font-bold text-white shadow-soft">{{ (current_firm_name[:2] if current_firm_name else 'AF')|upper }}</div>{% endif %}
@@ -387,26 +392,18 @@
</nav>
{% endif %}
</aside>
{% endif %}
<div class="min-h-screen">
{% if use_clean_top_nav %}
{% include "ui/templates/components/top_workspace_bar.html" %}
{% else %}
<header class="border-b border-slate-200 bg-white/90 backdrop-blur">
<div class="mx-auto max-w-7xl px-4 py-4 sm:px-6 lg:px-8">
<div class="flex items-start justify-between gap-4">
<div class="flex min-w-0 items-center gap-3">
{% if not show_legacy_sidebar and full_auth %}
{% if firm_branding.logo_url %}
<img src="{{ firm_branding.logo_url }}" alt="{{ current_firm_name }} logo" class="h-11 w-11 shrink-0 rounded-2xl border border-slate-200 bg-white object-contain p-1 shadow-soft" />
{% else %}
<div class="flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-brand-600 text-sm font-bold text-white shadow-soft">{{ (current_firm_name[:2] if current_firm_name else 'AF')|upper }}</div>
{% endif %}
{% endif %}
<div class="min-w-0">
<h1 class="truncate text-lg font-semibold text-slate-900">{{ title or "Module Workspace" }}</h1>
{% if not show_legacy_sidebar and full_auth %}
<div class="truncate text-xs text-slate-500">{{ current_firm_name }}{% if current_branch_name and current_branch_name != "-" %} • {{ current_branch_name }}{% endif %}{% if active_financial_year %} • FY {{ active_financial_year }}{% endif %}</div>
{% endif %}
</div>
<div>
<h1 class="text-lg font-semibold text-slate-900">{{ title or "Module Workspace" }}</h1>
</div>
<div class="text-right text-sm">
{% if full_auth %}
@@ -497,6 +494,7 @@
{% endif %}
</div>
</header>
{% endif %}
<main class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
{% if flash %}