183 lines
13 KiB
HTML
183 lines
13 KiB
HTML
{% set nav_path = request.url.path %}
|
|
{% set nav_roles = ui_roles if ui_roles is defined else [] %}
|
|
{% set nav_perms = ui_perms if ui_perms is defined else [] %}
|
|
{% set nav_workspace = 'employee' %}
|
|
{% if nav_path.startswith('/system-admin') %}{% set nav_workspace = 'system' %}
|
|
{% elif nav_path.startswith('/firm-admin') %}{% set nav_workspace = 'firm' %}
|
|
{% elif nav_path.startswith('/partner') %}{% set nav_workspace = 'partner' %}
|
|
{% elif nav_path.startswith('/manager') or nav_path.startswith('/employees/work') or nav_path.startswith('/employees/progress') or nav_path.startswith('/employees/attendance') or nav_path.startswith('/employees/leave') %}{% set nav_workspace = 'manager' %}
|
|
{% elif nav_path.startswith('/consultant') %}{% set nav_workspace = 'consultant' %}
|
|
{% elif nav_path.startswith('/client') %}{% set nav_workspace = 'client' %}
|
|
{% elif nav_path.startswith('/employee') %}{% set nav_workspace = 'employee' %}
|
|
{% elif 'System Admin' in nav_roles %}{% set nav_workspace = 'system' %}
|
|
{% elif 'Firm Admin' in nav_roles %}{% set nav_workspace = 'firm' %}
|
|
{% elif 'Partner' in nav_roles %}{% set nav_workspace = 'partner' %}
|
|
{% elif 'Manager' in nav_roles or 'Branch Manager' in nav_roles %}{% set nav_workspace = 'manager' %}
|
|
{% elif 'Consultant' in nav_roles %}{% set nav_workspace = 'consultant' %}
|
|
{% elif 'Client' in nav_roles %}{% set nav_workspace = 'client' %}
|
|
{% endif %}
|
|
|
|
{% macro nav_link(url, label, prefixes=None) -%}
|
|
{% set checks = prefixes if prefixes else [url] %}
|
|
{% set ns = namespace(active=false) %}
|
|
{% for prefix in checks %}{% if nav_path == prefix or nav_path.startswith(prefix ~ '/') %}{% set ns.active = true %}{% endif %}{% endfor %}
|
|
<a href="{{ url }}" class="af-nav-link {{ 'af-nav-link-active' if ns.active else '' }}" {% if ns.active %}aria-current="page"{% endif %}>{{ label }}</a>
|
|
{%- endmacro %}
|
|
|
|
{% macro dropdown(label, prefixes) -%}
|
|
{% set ns = namespace(active=false) %}
|
|
{% for prefix in prefixes %}{% if nav_path == prefix or nav_path.startswith(prefix ~ '/') %}{% set ns.active = true %}{% endif %}{% endfor %}
|
|
<details class="af-nav-dropdown group" data-af-nav-dropdown>
|
|
<summary class="af-nav-summary {{ 'af-nav-link-active' if ns.active else '' }}">{{ label }}<span aria-hidden="true" class="ml-1 text-[10px]">▼</span></summary>
|
|
<div class="af-nav-menu">{{ caller() }}</div>
|
|
</details>
|
|
{%- endmacro %}
|
|
|
|
<nav aria-label="Primary navigation" class="hidden lg:block">
|
|
<div class="flex min-w-0 items-center gap-1 overflow-visible">
|
|
{% if nav_workspace == 'system' %}
|
|
{{ nav_link('/system-admin/dashboard', 'Platform', ['/system-admin','/workspaces']) }}
|
|
{% call dropdown('Firms', ['/system-settings/tenants','/system-settings/branches','/wizards/system/firm']) %}
|
|
{{ nav_link('/system-settings/tenants', 'Audit Firms') }}
|
|
{{ nav_link('/system-settings/branches', 'Branches') }}
|
|
{{ nav_link('/wizards/system/firm/new', 'Create Firm Wizard') }}
|
|
{% endcall %}
|
|
{% call dropdown('Catalogue', ['/services/catalogue','/services/categories','/services/defaults','/marketplace']) %}
|
|
{{ nav_link('/services/catalogue', 'Service Catalogue') }}
|
|
{{ nav_link('/services/categories', 'Service Categories') }}
|
|
{{ nav_link('/services/defaults', 'System Default Tasks') }}
|
|
{{ nav_link('/marketplace', 'Marketplace') }}
|
|
{% endcall %}
|
|
{% call dropdown('Infrastructure', ['/domains','/email/platform-smtp','/documents/storage-nodes']) %}
|
|
{{ nav_link('/domains', 'Domain Mappings') }}
|
|
{{ nav_link('/domains/verification', 'DNS Verification') }}
|
|
{{ nav_link('/domains/ssl', 'SSL Status') }}
|
|
{{ nav_link('/email/platform-smtp', 'Platform SMTP') }}
|
|
{{ nav_link('/documents/storage-nodes', 'Storage Agents') }}
|
|
{% endcall %}
|
|
{{ nav_link('/platform-billing', 'Billing') }}
|
|
{% call dropdown('Administration', ['/system-settings/users','/system-settings/rbac','/system-settings/financial-years','/system-settings/audit-logs']) %}
|
|
{{ nav_link('/system-settings/users', 'Users') }}
|
|
{{ nav_link('/system-settings/rbac/roles', 'Roles & Permissions') }}
|
|
{{ nav_link('/system-settings/financial-years', 'Financial Years') }}
|
|
{{ nav_link('/system-settings/audit-logs', 'Audit Logs') }}
|
|
{% endcall %}
|
|
|
|
{% elif nav_workspace == 'firm' %}
|
|
{{ nav_link('/firm-admin/dashboard', 'Dashboard') }}
|
|
{% if can_view_clients(current_user, nav_perms, nav_roles) %}{% call dropdown('Clients', ['/clients']) %}
|
|
{{ nav_link('/clients', 'Client List') }}
|
|
{{ nav_link('/clients/new', 'Add Client') }}
|
|
{{ nav_link('/clients/import', 'Import Clients') }}
|
|
{{ nav_link('/clients/export', 'Export Clients') }}
|
|
{% endcall %}{% endif %}
|
|
{% call dropdown('Services', ['/services']) %}
|
|
{{ nav_link('/services', 'Firm Services') }}
|
|
{{ nav_link('/services/templates', 'Task Templates') }}
|
|
{{ nav_link('/services/bulk-imports', 'Bulk Imports') }}
|
|
{{ nav_link('/services/engagements', 'Engagements') }}
|
|
{% endcall %}
|
|
{% call dropdown('Team', ['/employees','/consultants']) %}
|
|
{{ nav_link('/employees', 'Employees') }}
|
|
{{ nav_link('/employees/work', 'Work Allocation') }}
|
|
{{ nav_link('/employees/attendance', 'Attendance') }}
|
|
{{ nav_link('/employees/leave', 'Leave') }}
|
|
{{ nav_link('/consultants', 'Consultants') }}
|
|
{% endcall %}
|
|
{% if can_view_documents_menu %}{{ nav_link('/documents', 'Documents') }}{% endif %}
|
|
{{ nav_link('/billing', 'Billing') }}
|
|
{% call dropdown('Firm Setup', ['/system-settings','/email/settings']) %}
|
|
{{ nav_link('/system-settings', 'Settings Dashboard') }}
|
|
{{ nav_link('/system-settings/branding', 'Branding') }}
|
|
{{ nav_link('/system-settings/branches', 'Branches') }}
|
|
{{ nav_link('/system-settings/users', 'Users') }}
|
|
{{ nav_link('/system-settings/rbac/roles', 'Roles & Permissions') }}
|
|
{{ nav_link('/system-settings/financial-years', 'Financial Years') }}
|
|
{{ nav_link('/email/settings', 'Email Settings') }}
|
|
{{ nav_link('/system-settings/audit-logs', 'Audit Logs') }}
|
|
{% endcall %}
|
|
|
|
{% elif nav_workspace == 'partner' %}
|
|
{{ nav_link('/partner/dashboard', 'Dashboard') }}
|
|
{{ nav_link('/partner/reviews', 'Reviews') }}
|
|
{{ nav_link('/partner/clients', 'Clients') }}
|
|
{{ nav_link('/services/engagements', 'Engagements') }}
|
|
{% if can_view_documents_menu %}{{ nav_link('/documents', 'Documents') }}{% endif %}
|
|
{{ nav_link('/billing', 'Billing') }}
|
|
{{ nav_link('/aqmm/dashboard', 'AQMM') }}
|
|
{{ nav_link('/peer-review/evidence', 'Peer Review') }}
|
|
|
|
{% elif nav_workspace == 'manager' %}
|
|
{{ nav_link('/manager/dashboard', 'Dashboard') }}
|
|
{% if can_manage_employee_work(current_user, nav_perms, nav_roles) %}{{ nav_link('/manager/work', 'Work Board') }}{{ nav_link('/employees/work', 'Allocation') }}{% endif %}
|
|
{% if can_view_employee_progress(current_user, nav_perms, nav_roles) %}{{ nav_link('/employees/progress', 'Progress') }}{% endif %}
|
|
{% if can_view_all_employee_attendance(current_user, nav_perms, nav_roles) %}{{ nav_link('/employees/attendance', 'Attendance') }}{% endif %}
|
|
{% if can_view_all_employee_leave(current_user, nav_perms, nav_roles) %}{{ nav_link('/employees/leave', 'Leave') }}{% endif %}
|
|
|
|
{% elif nav_workspace == 'employee' %}
|
|
{% if can_view_employee_portal(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/dashboard', 'Dashboard') }}{% endif %}
|
|
{% if can_view_own_employee_work(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/work', 'Work') }}{% endif %}
|
|
{% if can_view_own_employee_attendance(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/attendance', 'Attendance') }}{% endif %}
|
|
{% if can_view_own_employee_leave(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/leave', 'Leave') }}{% endif %}
|
|
{% if can_view_own_employee_documents(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/documents', 'Documents') }}{% endif %}
|
|
{% if can_view_own_employee_payslips(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/payslips', 'Payslips') }}{% endif %}
|
|
{% if can_request_own_employee_offboarding(current_user, nav_perms, nav_roles) %}{{ nav_link('/employee/offboarding', 'Offboarding') }}{% endif %}
|
|
|
|
{% elif nav_workspace == 'consultant' %}
|
|
{{ nav_link('/consultant/dashboard', 'Dashboard') }}
|
|
{{ nav_link('/consultant/work', 'Work', ['/consultant/work','/consultant/assignments']) }}
|
|
{{ nav_link('/consultant/managed-clients', 'Clients') }}
|
|
{{ nav_link('/consultant/service-requests', 'Requests') }}
|
|
{{ nav_link('/consultant/documents', 'Documents') }}
|
|
{{ nav_link('/consultant/communications', 'Messages') }}
|
|
{{ nav_link('/consultant/workspace', 'Workspace') }}
|
|
|
|
{% elif nav_workspace == 'client' %}
|
|
{{ nav_link('/client/dashboard', 'Dashboard') }}
|
|
{{ nav_link('/client/compliance', 'Compliance', ['/client/compliance','/client/engagements']) }}
|
|
{{ nav_link('/client/documents', 'Documents') }}
|
|
{{ nav_link('/client/messages', 'Messages') }}
|
|
{{ nav_link('/client/billing', 'Bills & Payments') }}
|
|
{% endif %}
|
|
</div>
|
|
</nav>
|
|
|
|
<div id="af-mobile-nav" class="fixed inset-0 z-[80] hidden lg:hidden" aria-hidden="true">
|
|
<button type="button" class="absolute inset-0 bg-slate-950/45" data-af-mobile-close aria-label="Close navigation"></button>
|
|
<div class="absolute inset-y-0 left-0 w-[86vw] max-w-sm overflow-y-auto bg-white p-4 shadow-2xl">
|
|
<div class="mb-4 flex items-center justify-between border-b border-slate-200 pb-3">
|
|
<div><div class="text-sm font-bold text-slate-900">Navigation</div><div class="text-xs text-slate-500">{{ current_firm_name }}</div></div>
|
|
<button type="button" data-af-mobile-close class="rounded-xl border border-slate-200 px-3 py-2 text-sm font-semibold text-slate-700">Close</button>
|
|
</div>
|
|
<div class="space-y-1" data-af-mobile-links></div>
|
|
<div class="mt-5 space-y-3 border-t border-slate-200 pt-4">
|
|
<div class="text-[11px] font-bold uppercase tracking-wider text-slate-400">Workspace context</div>
|
|
<a href="/workspaces" class="block rounded-xl border border-slate-200 px-3 py-2 text-sm font-semibold text-slate-700">Change workspace</a>
|
|
{% if can_switch_service_tenant(current_user, nav_perms, nav_roles) or can_switch_employee_tenant(current_user, nav_perms, nav_roles) %}
|
|
{% set mobile_tenants = get_context_tenants(request, current_user, nav_perms, nav_roles) %}
|
|
<select aria-label="Active Audit Firm" onchange="if(this.value){window.location.href=this.value;}" class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
|
|
{% for tenant in mobile_tenants %}<option value="/system-settings/context/tenant/{{ tenant.id }}" {% if tenant.id == active_tenant_id %}selected{% endif %}>{{ tenant.name }}</option>{% endfor %}
|
|
</select>
|
|
{% endif %}
|
|
{% if can_switch_service_branch(current_user, nav_perms, nav_roles) or can_switch_employee_branch(current_user, nav_perms, nav_roles) %}
|
|
{% set mobile_branches = get_context_branches(request, current_user, nav_perms, nav_roles) %}
|
|
<select aria-label="Active Branch" onchange="if(this.value){window.location.href=this.value;}" class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
|
|
<option value="/system-settings/context/branch/0" {% if not active_branch_id %}selected{% endif %}>All Branches</option>
|
|
{% for branch in mobile_branches %}<option value="/system-settings/context/branch/{{ branch.id }}" {% if branch.id == active_branch_id %}selected{% endif %}>{{ branch.name }}</option>{% endfor %}
|
|
</select>
|
|
{% endif %}
|
|
{% if can_view_settings(current_user, nav_perms, nav_roles) %}
|
|
{% set mobile_fys = get_context_financial_years(request, current_user, nav_perms, nav_roles) %}
|
|
<select aria-label="Active Financial Year" onchange="if(this.value){window.location.href=this.value;}" class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
|
|
{% for fy in mobile_fys %}<option value="/system-settings/context/financial-year/{{ fy.year_code }}" {% if fy.year_code == active_financial_year %}selected{% endif %}>FY {{ fy.year_code }}{% if fy.is_current %} (Current){% endif %}</option>{% endfor %}
|
|
</select>
|
|
{% endif %}
|
|
</div>
|
|
<div class="mt-5 space-y-1 border-t border-slate-200 pt-4">
|
|
{% if "Consultant" in nav_roles %}<a class="block rounded-xl px-3 py-2 text-sm text-slate-700 hover:bg-slate-50" href="/consultant/profile">My Profile</a>{% elif "Client" in nav_roles %}<a class="block rounded-xl px-3 py-2 text-sm text-slate-700 hover:bg-slate-50" href="/client/profile">My Profile</a>{% else %}<a class="block rounded-xl px-3 py-2 text-sm text-slate-700 hover:bg-slate-50" href="/employee/profile">My Profile</a>{% endif %}
|
|
<a class="block rounded-xl px-3 py-2 text-sm text-slate-700 hover:bg-slate-50" href="/change-password">Change Password</a>
|
|
<a class="block rounded-xl px-3 py-2 text-sm font-semibold text-red-600 hover:bg-red-50" href="/logout">Logout</a>
|
|
</div>
|
|
</div>
|
|
</div>
|