Unify Partner navigation and align full-width header
This commit is contained in:
@@ -1,19 +1,26 @@
|
||||
{% if navigation_render_location_v2|default('page') == 'global-host' or not global_role_navigation_host_v2|default(false) %}
|
||||
{#
|
||||
UI/UX V2 Phase 1D — Partner pilot navigation
|
||||
|
||||
Presentation-only replacement for the existing partner tab strip.
|
||||
Existing URLs, route protection, dashboard content, forms and page actions
|
||||
are unchanged.
|
||||
UI/UX V2 Phase 1D.5 — Unified Partner navigation.
|
||||
Presentation only. Existing routes and route-level permissions remain authoritative.
|
||||
#}
|
||||
{% set _partner_path = request.url.path %}
|
||||
{% set _partner_tab = request.query_params.get('tab', 'overview') %}
|
||||
{% set navigation_aria_label_v2 = 'Partner workspace navigation' %}
|
||||
{% set navigation_items_v2 = [
|
||||
{
|
||||
'label': 'Dashboard',
|
||||
'url': '/partner/dashboard',
|
||||
'visible': true,
|
||||
'active': _partner_path == '/partner/dashboard'
|
||||
'active': _partner_path.startswith('/partner/dashboard'),
|
||||
'children': [
|
||||
{'label': 'Overview', 'url': '/partner/dashboard?tab=overview', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'overview'},
|
||||
{'label': 'Branch Work', 'url': '/partner/dashboard?tab=branch-work', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'branch-work'},
|
||||
{'label': 'Clients', 'url': '/partner/dashboard?tab=clients', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'clients'},
|
||||
{'label': 'Staff', 'url': '/partner/dashboard?tab=staff', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'staff'},
|
||||
{'label': 'Review', 'url': '/partner/dashboard?tab=review', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'review'},
|
||||
{'label': 'Billing', 'url': '/partner/dashboard?tab=billing', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'billing'},
|
||||
{'label': 'Reports', 'url': '/partner/dashboard?tab=reports', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'reports'},
|
||||
{'label': 'Wizards', 'url': '/partner/dashboard?tab=wizards', 'active': _partner_path.startswith('/partner/dashboard') and _partner_tab == 'wizards'}
|
||||
]
|
||||
},
|
||||
{
|
||||
'label': 'Review Board',
|
||||
@@ -54,8 +61,57 @@
|
||||
}
|
||||
] %}
|
||||
|
||||
<div class="mb-6 overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-soft" data-uiux-v2-pilot="partner">
|
||||
<div class="border-b border-slate-200 bg-white shadow-sm" data-uiux-v2-pilot="partner">
|
||||
{% include "ui/templates/components/navigation_v2.html" %}
|
||||
{% include "ui/templates/components/mobile_navigation_v2.html" %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function initialisePartnerDropdowns() {
|
||||
var root = document.querySelector('[data-uiux-v2-pilot="partner"]');
|
||||
if (!root || root.dataset.dropdownAutoCloseInitialised === 'true') return;
|
||||
|
||||
var desktopNav = root.querySelector('nav[data-uiux-v2="desktop-navigation"]');
|
||||
if (!desktopNav) return;
|
||||
|
||||
root.dataset.dropdownAutoCloseInitialised = 'true';
|
||||
var dropdowns = Array.from(desktopNav.querySelectorAll('details'));
|
||||
|
||||
function closeAllExcept(exception) {
|
||||
dropdowns.forEach(function (details) {
|
||||
if (details !== exception) details.removeAttribute('open');
|
||||
});
|
||||
}
|
||||
|
||||
dropdowns.forEach(function (details) {
|
||||
details.addEventListener('toggle', function () {
|
||||
if (details.open) closeAllExcept(details);
|
||||
});
|
||||
|
||||
details.querySelectorAll('a[href]').forEach(function (link) {
|
||||
link.addEventListener('click', function () {
|
||||
details.removeAttribute('open');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
if (!root.contains(event.target)) closeAllExcept(null);
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Escape') closeAllExcept(null);
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initialisePartnerDropdowns, { once: true });
|
||||
} else {
|
||||
initialisePartnerDropdowns();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% set _uiux_full_width_header = ('System Admin' in (ui_roles|default([], true))) or ('Firm Admin' in (ui_roles|default([], true))) %}
|
||||
{% set _uiux_full_width_header = ('System Admin' in (ui_roles|default([], true))) or ('Firm Admin' in (ui_roles|default([], true))) or ('Partner' in (ui_roles|default([], true))) %}
|
||||
<header class="sticky top-0 z-40 border-b border-slate-200/70 {{ 'bg-white/95' if _uiux_full_width_header else 'bg-slate-100/85' }} backdrop-blur-xl">
|
||||
<div class="{{ 'w-full px-4 py-3 sm:px-6 lg:px-8' if _uiux_full_width_header else 'mx-auto max-w-[1500px] px-3 py-3 sm:px-6 lg:px-8' }}">
|
||||
<div class="{{ 'border-0 bg-transparent px-0 py-0 shadow-none' if _uiux_full_width_header else 'rounded-3xl border border-slate-200 bg-white/95 px-3 py-3 shadow-soft sm:px-4' }}">
|
||||
|
||||
Reference in New Issue
Block a user