diff --git a/src/PowderCoating.Web/Views/Shared/_Layout.cshtml b/src/PowderCoating.Web/Views/Shared/_Layout.cshtml index b8fdcdd..0192ce1 100644 --- a/src/PowderCoating.Web/Views/Shared/_Layout.cshtml +++ b/src/PowderCoating.Web/Views/Shared/_Layout.cshtml @@ -32,6 +32,15 @@ _ => "#374151" // gray-700 for anything else }; + // Nav mode: used by FOUC-prevention inline script + nav-mode.js + var _finCtrlSet = new HashSet(StringComparer.OrdinalIgnoreCase) { + "bills", "accounts", "journalentries", "vendorcredits", + "bankreconciliations", "fixedassets", "budgets", "recurringtemplates", + "accountingexport", "taxrates" + }; + var _navController = ViewContext.RouteData.Values["controller"]?.ToString() ?? ""; + var _serverNavMode = _finCtrlSet.Contains(_navController) ? "fin" : "ops"; + if (User.Identity?.IsAuthenticated == true) { if (isImpersonating) @@ -319,6 +328,54 @@ width: 1.5rem; } + /* ── Nav mode: FOUC prevention — CSS wins before JS runs ─────── */ + html[data-nav-mode="ops"] [data-nav="fin"] { display: none !important; } + html[data-nav-mode="fin"] [data-nav="ops"] { display: none !important; } + + /* ── Nav mode strip (Operations | Finance tab switcher) ──────── */ + .nav-mode-strip { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 3px; + padding: 8px 12px 10px; + border-bottom: 1px solid rgba(255,255,255,0.08); + } + + .nav-mode-btn { + display: flex; + align-items: center; + justify-content: center; + gap: 5px; + padding: 7px 6px; + border: none; + border-radius: 5px; + font-family: var(--font-mono, 'IBM Plex Mono', ui-monospace, monospace); + font-size: 0.64rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.08em; + cursor: pointer; + transition: background 0.15s, color 0.15s; + background: transparent; + color: rgba(255,255,255,0.38); + white-space: nowrap; + } + + .nav-mode-btn i { + font-size: 0.85rem; + flex-shrink: 0; + } + + .nav-mode-btn:hover { + background: rgba(255,255,255,0.08); + color: rgba(255,255,255,0.8); + } + + .nav-mode-btn.active { + background: var(--pcl-ember, #d97706); + color: #fff; + } + /* Main Content */ .main-content { margin-left: var(--sidebar-width); @@ -878,7 +935,10 @@ @* Page-specific styles *@ @await RenderSectionAsync("Styles", required: false) - + + @if (_isNonProd) {
Main Menu
- + + Dashboard @if (!isPlatformAdmin) { + @* ── Operations ───────────────────────────────────────────── *@ @if (showOperations) { - + } @if (hasCustomers) { - + Customers } @if (hasQuotes) { - + Quotes } @if (hasJobs) { - + Jobs } @if (hasInvoices) { - + Invoices } @if (hasCalendar) { - + Appointments } @if (hasJobs) { - + Daily Board @@ -1069,19 +1139,19 @@ @if (hasInvoices) { var _allowOnlinePayments = Context.Items["AllowOnlinePayments"] as bool? ?? false; - + @if (_allowOnlinePayments) { - + Online Payments } - + Credit Memos - + Gift Certificates @@ -1090,18 +1160,18 @@ @* ── Inventory & Purchasing ───────────────────────────────── *@ @if (hasProducts || showInventorySection) { - + } @if (hasProducts) { - + Product Catalog } @if (hasInventory) { - + Inventory @@ -1109,11 +1179,11 @@ } @if (hasVendors) { - + Vendors - + Purchase Orders @@ -1125,46 +1195,50 @@ var _allowAccounting = Context.Items["AllowAccounting"] as bool? ?? false; if (_allowAccounting) { - - + + Bills / Expenses - + + + Vendors + + Chart of Accounts - + Journal Entries - + Vendor Credits - + Bank Reconciliation - + Fixed Assets - + Budgets - + Year-End Close - + Recurring Transactions if (hasReports) { - + Accounting Export @@ -1173,33 +1247,33 @@ } @* ── Shop Floor ───────────────────────────────────────────── *@ - + @if (hasEquipment) { - + Equipment } @if (hasMaintenance) { - + Maintenance } @if (hasInventory || _isAdminOrManager) { - + Powder Insights } - + Shop Display - + Shop Mobile @@ -1207,17 +1281,17 @@ @* ── Reports & Templates ──────────────────────────────────── *@ @if (hasReports || hasJobs) { - + @if (hasReports) { - + Reports } @if (hasJobs) { - + Job Templates @@ -1680,6 +1754,9 @@ + + +