Activate UIUX V2 navigation for System Admin

This commit is contained in:
A R R R Associates
2026-07-10 21:46:46 +05:30
parent 69b33fa486
commit 79eb45c675
3 changed files with 160 additions and 29 deletions
@@ -5,7 +5,7 @@
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.24em] text-brand-600">Platform Control Centre</p>
<h1 class="mt-2 text-2xl font-bold text-slate-900">System Admin Dashboard V2</h1>
<h1 class="mt-2 text-2xl font-bold text-slate-900">System Administration Dashboard</h1>
<p class="mt-1 text-sm text-slate-500">Monitor firm readiness, catalogue health, SMTP, storage, billing readiness, reports, wizards and audit logs.</p>
</div>
<div class="flex flex-wrap gap-2">
@@ -14,32 +14,53 @@
<a href="/platform-billing" class="rounded-xl border border-slate-200 px-4 py-2 text-sm font-semibold text-slate-700 hover:bg-slate-50">Platform Billing</a>
</div>
</div>
</div>
{% 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')
] %}
<div class="mt-6 overflow-x-auto">
<div class="flex min-w-max gap-2 rounded-2xl bg-slate-100 p-1">
{% for tab_key, tab_label in tabs %}
<a href="/system-admin/dashboard?tab={{ tab_key }}"
data-dashboard-tab="{{ tab_key }}"
class="system-admin-tab rounded-xl px-4 py-2 text-sm font-semibold transition {% if active_tab == tab_key %}bg-white text-brand-700 shadow-soft{% else %}text-slate-600 hover:bg-white hover:text-slate-900{% endif %}">
{{ tab_label }}
</a>
{% endfor %}
</div>
{% 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')
] %}
<div class="hidden rounded-3xl border border-slate-200 bg-white p-2 shadow-soft sm:block">
<div class="flex gap-2 overflow-x-auto" id="system-admin-dashboard-tabs">
{% for tab_key, tab_label in tabs %}
<button type="button"
data-dashboard-tab="{{ tab_key }}"
class="system-admin-tab whitespace-nowrap rounded-2xl px-4 py-2 text-sm font-semibold transition {% if active_tab == tab_key %}bg-brand-600 text-white{% else %}text-slate-600 hover:bg-slate-100{% endif %}">
{{ tab_label }}
</button>
{% endfor %}
</div>
</div>
<details id="system-admin-mobile-menu" class="group overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-soft sm:hidden">
<summary class="flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-slate-800">
<span class="inline-flex items-center gap-2">
<svg class="h-5 w-5 group-open:hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path stroke-linecap="round" d="M4 6h16M4 12h16M4 18h16" /></svg>
<svg class="hidden h-5 w-5 group-open:block" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path stroke-linecap="round" d="M6 6l12 12M18 6 6 18" /></svg>
<span>Dashboard Menu</span>
</span>
<span class="text-xs font-medium text-slate-500">Platform dashboard sections</span>
</summary>
<div class="space-y-1 border-t border-slate-100 bg-slate-50/80 p-3">
{% for tab_key, tab_label in tabs %}
<button type="button"
data-dashboard-tab="{{ tab_key }}"
class="system-admin-tab block w-full rounded-xl px-3 py-2.5 text-left text-sm font-semibold transition {% if active_tab == tab_key %}bg-brand-600 text-white{% else %}bg-white text-slate-700 hover:bg-slate-100{% endif %}">
{{ tab_label }}
</button>
{% endfor %}
</div>
</details>
<div id="system-admin-dashboard-panel"
data-initial-tab="{{ active_tab }}"
class="min-h-[360px]">
@@ -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 = '<div class="rounded-3xl border border-red-200 bg-red-50 p-6 text-sm text-red-700 shadow-soft">Unable to load this tab. Please refresh the page.</div>';
}
}
tabs.forEach((tab) => {
tab.addEventListener('click', function (event) {
event.preventDefault();
tab.addEventListener('click', function () {
loadTab(tab.dataset.dashboardTab, true);
});
});