Add firm admin dashboard and workspace switcher

This commit is contained in:
A R R R Associates
2026-07-04 16:22:45 +05:30
parent 7e10558186
commit a3b57155cf
17 changed files with 752 additions and 22 deletions
+1
View File
@@ -406,6 +406,7 @@
Your Firm: {{ current_firm_name }}
• Branch: {{ current_branch_name }}{% if active_financial_year %} • FY: {{ active_financial_year }}{% endif %}
</div>
{% include "ui/templates/components/workspace_switcher.html" %}
<div class="mt-2 flex justify-end gap-2">
{% if "Consultant" in ui_roles %}
<a class="inline-flex rounded-lg border border-slate-300 px-3 py-1.5 text-xs font-medium text-slate-700 hover:bg-slate-50" href="/consultant/profile">My Profile</a>
@@ -0,0 +1,25 @@
{% if full_auth %}
{% set ws = namespace(count=0) %}
{% if 'System Admin' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Firm Admin' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Partner' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Manager' in ui_roles or 'Branch Manager' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Staff' in ui_roles or can_view_employee_portal(current_user, ui_perms, ui_roles) %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Client' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if 'Consultant' in ui_roles %}{% set ws.count = ws.count + 1 %}{% endif %}
{% if ws.count > 1 %}
<div class="mt-2 flex justify-end">
<label class="sr-only" for="workspace_switcher">Workspace</label>
<select id="workspace_switcher" onchange="if(this.value){window.location.href=this.value;}" class="max-w-xs rounded-lg border border-brand-200 bg-brand-50 px-3 py-1.5 text-xs font-semibold text-brand-800 shadow-sm hover:bg-brand-100">
<option value="">Workspace: switch view</option>
{% if 'System Admin' in ui_roles %}<option value="/system-admin/dashboard" {% if current_path.startswith('/system-admin') %}selected{% endif %}>System Admin - Platform Control</option>{% endif %}
{% if 'Partner' in ui_roles %}<option value="/partner/dashboard" {% if current_path.startswith('/partner') %}selected{% endif %}>Partner Operations</option>{% endif %}
{% if 'Firm Admin' in ui_roles %}<option value="/firm-admin/dashboard" {% if current_path.startswith('/firm-admin') %}selected{% endif %}>Firm Administration</option>{% endif %}
{% if 'Manager' in ui_roles or 'Branch Manager' in ui_roles %}<option value="/manager/dashboard" {% if current_path.startswith('/manager') %}selected{% endif %}>Manager / Team Workspace</option>{% endif %}
{% if 'Staff' in ui_roles or can_view_employee_portal(current_user, ui_perms, ui_roles) %}<option value="/employee/dashboard" {% if current_path.startswith('/employee') %}selected{% endif %}>My Staff Workspace</option>{% endif %}
{% if 'Client' in ui_roles %}<option value="/client/dashboard" {% if current_path.startswith('/client') %}selected{% endif %}>Client Portal</option>{% endif %}
{% if 'Consultant' in ui_roles %}<option value="/consultant/dashboard" {% if current_path.startswith('/consultant') %}selected{% endif %}>Consultant Workspace</option>{% endif %}
</select>
</div>
{% endif %}
{% endif %}