diff --git a/app/modules/system_admin_dashboard/templates/system_admin_dashboard/dashboard.html b/app/modules/system_admin_dashboard/templates/system_admin_dashboard/dashboard.html index 0c8c2bd..595eaed 100644 --- a/app/modules/system_admin_dashboard/templates/system_admin_dashboard/dashboard.html +++ b/app/modules/system_admin_dashboard/templates/system_admin_dashboard/dashboard.html @@ -5,7 +5,7 @@

Platform Control Centre

-

System Admin Dashboard V2

+

System Administration Dashboard

Monitor firm readiness, catalogue health, SMTP, storage, billing readiness, reports, wizards and audit logs.

@@ -14,32 +14,53 @@ Platform Billing
+ - {% set tabs = [ - ('overview', 'Overview'), - ('firms', 'Firms'), - ('firm-setup-health', 'Setup Health'), - ('catalogue', 'Service Catalogue'), - ('smtp', 'Platform SMTP'), - ('storage', 'Storage'), - ('billing', 'Billing Readiness'), - ('reports', 'Reports'), - ('wizards', 'Wizards'), - ('audit-logs', 'Audit Logs') - ] %} -
-
- {% for tab_key, tab_label in tabs %} - - {{ tab_label }} - - {% endfor %} -
+ {% set tabs = [ + ('overview', 'Overview'), + ('firms', 'Firms'), + ('firm-setup-health', 'Setup Health'), + ('catalogue', 'Service Catalogue'), + ('smtp', 'Platform SMTP'), + ('storage', 'Storage'), + ('billing', 'Billing Readiness'), + ('reports', 'Reports'), + ('wizards', 'Wizards'), + ('audit-logs', 'Audit Logs') + ] %} + + +
+ + + + + Dashboard Menu + + Platform dashboard sections + +
+ {% for tab_key, tab_label in tabs %} + + {% endfor %} +
+
+
@@ -56,10 +77,11 @@ function setActive(tabName) { tabs.forEach((tab) => { const active = tab.dataset.dashboardTab === tabName; - tab.classList.toggle('bg-white', active); - tab.classList.toggle('text-brand-700', active); - tab.classList.toggle('shadow-soft', active); + tab.classList.toggle('bg-brand-600', active); + tab.classList.toggle('text-white', active); tab.classList.toggle('text-slate-600', !active); + tab.classList.toggle('bg-white', !active && tab.closest('#system-admin-mobile-menu')); + tab.classList.toggle('hover:bg-slate-100', !active); }); } @@ -77,14 +99,15 @@ url.searchParams.set('tab', tabName); history.pushState({ tab: tabName }, '', url.toString()); } + const mobileMenu = document.getElementById('system-admin-mobile-menu'); + if (mobileMenu) mobileMenu.open = false; } catch (err) { panel.innerHTML = '
Unable to load this tab. Please refresh the page.
'; } } tabs.forEach((tab) => { - tab.addEventListener('click', function (event) { - event.preventDefault(); + tab.addEventListener('click', function () { loadTab(tab.dataset.dashboardTab, true); }); }); diff --git a/app/ui/templates/base/layout.html b/app/ui/templates/base/layout.html index 8f2acb1..7b04dfc 100644 --- a/app/ui/templates/base/layout.html +++ b/app/ui/templates/base/layout.html @@ -111,7 +111,7 @@ 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 %} + {% set use_clean_top_nav = full_auth %}
@@ -404,6 +404,9 @@
{% if use_clean_top_nav %} {% include "ui/templates/components/top_workspace_bar.html" %} + {% if is_system_admin_user %} + {% include "ui/templates/components/system_admin_navigation_v2.html" %} + {% endif %} {% else %}
diff --git a/app/ui/templates/components/system_admin_navigation_v2.html b/app/ui/templates/components/system_admin_navigation_v2.html new file mode 100644 index 0000000..058e504 --- /dev/null +++ b/app/ui/templates/components/system_admin_navigation_v2.html @@ -0,0 +1,105 @@ +{# + UI/UX V2 Phase 1F — System Admin workspace navigation. + Presentation only. Existing routes and route-level permissions remain authoritative. +#} +{% set _system_admin_path = request.url.path %} +{% set navigation_aria_label_v2 = 'System administration navigation' %} +{% set navigation_items_v2 = [ + { + 'label': 'Dashboard', + 'url': '/system-admin/dashboard', + 'visible': true, + 'active': _system_admin_path.startswith('/system-admin/dashboard') + }, + { + 'label': 'Firms', + 'visible': true, + 'active': _system_admin_path.startswith('/system-settings/tenants') or _system_admin_path.startswith('/system-settings/branches') or _system_admin_path.startswith('/wizards/system/firm'), + 'children': [ + {'label': 'Audit Firms', 'url': '/system-settings/tenants', 'active': _system_admin_path.startswith('/system-settings/tenants')}, + {'label': 'Branches', 'url': '/system-settings/branches', 'active': _system_admin_path.startswith('/system-settings/branches')}, + {'label': 'Create Firm Wizard', 'url': '/wizards/system/firm/new', 'active': _system_admin_path.startswith('/wizards/system/firm')} + ] + }, + { + 'label': 'Catalogue', + 'visible': true, + 'active': _system_admin_path.startswith('/services/catalogue') or _system_admin_path.startswith('/services/categories') or _system_admin_path.startswith('/services/defaults') or _system_admin_path.startswith('/services/templates') or _system_admin_path.startswith('/services/bulk-imports'), + 'children': [ + {'label': 'Service Catalogue', 'url': '/services/catalogue', 'active': _system_admin_path == '/services/catalogue'}, + {'label': 'Create Catalogue Service', 'url': '/services/catalogue/new', 'active': _system_admin_path.startswith('/services/catalogue/new')}, + {'label': 'Service Categories', 'url': '/services/categories', 'active': _system_admin_path.startswith('/services/categories')}, + {'label': 'System Default Tasks', 'url': '/services/defaults', 'active': _system_admin_path.startswith('/services/defaults')}, + {'label': 'Task Templates', 'url': '/services/templates', 'active': _system_admin_path.startswith('/services/templates')}, + {'label': 'Bulk Imports', 'url': '/services/bulk-imports', 'active': _system_admin_path.startswith('/services/bulk-imports')} + ] + }, + { + 'label': 'Platform', + 'visible': true, + 'active': _system_admin_path.startswith('/domains') or _system_admin_path.startswith('/email/platform-smtp') or _system_admin_path.startswith('/platform-billing') or _system_admin_path.startswith('/marketplace'), + 'children': [ + {'label': 'Domain Mappings', 'url': '/domains', 'active': _system_admin_path == '/domains'}, + {'label': 'Tenant Subdomains', 'url': '/domains/tenant-subdomains', 'active': _system_admin_path.startswith('/domains/tenant-subdomains')}, + {'label': 'Firm Domains', 'url': '/domains/firm-domain', 'active': _system_admin_path.startswith('/domains/firm-domain')}, + {'label': 'Consultant Domains', 'url': '/domains/consultant-domains', 'active': _system_admin_path.startswith('/domains/consultant-domains')}, + {'label': 'DNS Verification', 'url': '/domains/verification', 'active': _system_admin_path.startswith('/domains/verification')}, + {'label': 'SSL Status', 'url': '/domains/ssl', 'active': _system_admin_path.startswith('/domains/ssl')}, + {'label': 'Platform SMTP', 'url': '/email/platform-smtp', 'active': _system_admin_path.startswith('/email/platform-smtp')}, + {'label': 'Platform Billing', 'url': '/platform-billing', 'active': _system_admin_path.startswith('/platform-billing')}, + {'label': 'Marketplace', 'url': '/marketplace', 'active': _system_admin_path.startswith('/marketplace')} + ] + }, + { + 'label': 'Operations', + 'visible': true, + 'active': _system_admin_path.startswith('/documents/storage-nodes') or _system_admin_path.startswith('/documents/branch-storage-dashboard') or _system_admin_path.startswith('/documents/storage-jobs') or _system_admin_path.startswith('/documents/download-requests'), + 'children': [ + {'label': 'Storage Nodes', 'url': '/documents/storage-nodes', 'active': _system_admin_path.startswith('/documents/storage-nodes')}, + {'label': 'Branch Storage Dashboard', 'url': '/documents/branch-storage-dashboard', 'active': _system_admin_path.startswith('/documents/branch-storage-dashboard')}, + {'label': 'Storage Jobs', 'url': '/documents/storage-jobs', 'active': _system_admin_path.startswith('/documents/storage-jobs')}, + {'label': 'Download Requests', 'url': '/documents/download-requests', 'active': _system_admin_path.startswith('/documents/download-requests')} + ] + }, + { + 'label': 'Firm Operations', + 'visible': true, + 'active': _system_admin_path.startswith('/clients') or _system_admin_path.startswith('/services') or _system_admin_path.startswith('/employees') or _system_admin_path.startswith('/consultants') or _system_admin_path.startswith('/documents') or _system_admin_path.startswith('/billing') or _system_admin_path.startswith('/notice-cases'), + 'children': [ + {'label': 'Clients', 'url': '/clients', 'active': _system_admin_path.startswith('/clients')}, + {'label': 'Firm Services', 'url': '/services', 'active': _system_admin_path == '/services'}, + {'label': 'Engagements', 'url': '/services/engagements', 'active': _system_admin_path.startswith('/services/engagements')}, + {'label': 'Employees', 'url': '/employees', 'active': _system_admin_path.startswith('/employees')}, + {'label': 'Consultants', 'url': '/consultants', 'active': _system_admin_path.startswith('/consultants')}, + {'label': 'Documents', 'url': '/documents', 'active': _system_admin_path == '/documents'}, + {'label': 'Billing', 'url': '/billing', 'active': _system_admin_path.startswith('/billing')}, + {'label': 'Notice & Cases', 'url': '/notice-cases', 'active': _system_admin_path.startswith('/notice-cases')} + ] + }, + { + 'label': 'Administration', + 'visible': true, + 'active': _system_admin_path.startswith('/system-settings') or _system_admin_path.startswith('/email/settings'), + 'children': [ + {'label': 'Settings Dashboard', 'url': '/system-settings', 'active': _system_admin_path == '/system-settings'}, + {'label': 'Users', 'url': '/system-settings/users', 'active': _system_admin_path.startswith('/system-settings/users')}, + {'label': 'Roles & Permissions', 'url': '/system-settings/rbac/roles', 'active': _system_admin_path.startswith('/system-settings/rbac')}, + {'label': 'Financial Years', 'url': '/system-settings/financial-years', 'active': _system_admin_path.startswith('/system-settings/financial-years')}, + {'label': 'Branding', 'url': '/system-settings/branding', 'active': _system_admin_path.startswith('/system-settings/branding')}, + {'label': 'Firm Email Settings', 'url': '/email/settings', 'active': _system_admin_path.startswith('/email/settings')}, + {'label': 'Audit Logs', 'url': '/system-settings/audit-logs', 'active': _system_admin_path.startswith('/system-settings/audit-logs')} + ] + }, + { + 'label': 'Alerts', + 'url': '/alerts', + 'visible': true, + 'active': _system_admin_path.startswith('/alerts'), + 'badge': unread_alert_count if unread_alert_count is defined and unread_alert_count > 0 else none + } +] %} + +
+ {% include "ui/templates/components/navigation_v2.html" %} + {% include "ui/templates/components/mobile_navigation_v2.html" %} +