diff --git a/app/ui/templates/base/layout.html b/app/ui/templates/base/layout.html index 5bbc86f..a5870d7 100644 --- a/app/ui/templates/base/layout.html +++ b/app/ui/templates/base/layout.html @@ -101,8 +101,25 @@ {% set domain_context = get_domain_context(request) %} {% set is_system_admin_user = full_auth and ("System Admin" in ui_roles) %} {% set can_manage_local_storage_agent = full_auth and can_view_documents(current_user, ui_perms, ui_roles) and can_upload_documents(current_user, ui_perms, ui_roles) and (ui_roles|select("in", ["Firm Admin", "Partner", "Branch Manager"])|list|length > 0) %} + {% set clean_workspace_paths = [ + '/system-admin/dashboard', + '/firm-admin/dashboard', + '/partner/dashboard', + '/manager/dashboard', + '/employee/dashboard', + '/client/dashboard', + '/consultant/dashboard', + '/workspaces' + ] %} + {% set clean_nav_state = namespace(enabled=False) %} + {% for clean_path in clean_workspace_paths %} + {% if current_path.startswith(clean_path) %}{% set clean_nav_state.enabled = True %}{% endif %} + {% endfor %} + {% set use_clean_top_nav = full_auth and clean_nav_state.enabled %} -
+ +
+ {% if not use_clean_top_nav %} + {% endif %} +
+ {% if use_clean_top_nav %} + {% include "ui/templates/components/top_workspace_bar.html" %} + {% else %}
@@ -482,6 +504,7 @@ {% endif %}
+ {% endif %}
{% if flash %} diff --git a/app/ui/templates/components/top_workspace_bar.html b/app/ui/templates/components/top_workspace_bar.html new file mode 100644 index 0000000..a4aa317 --- /dev/null +++ b/app/ui/templates/components/top_workspace_bar.html @@ -0,0 +1,85 @@ +
+
+
+
+ + {% if firm_branding.logo_url %} + {{ current_firm_name }} logo + {% else %} +
{{ (current_firm_name[:2] if current_firm_name else 'AF')|upper }}
+ {% endif %} +
+
{{ current_firm_name }}
+
{{ current_branch_name if active_branch_id else 'All Branches' }}{% if active_financial_year %} • FY {{ active_financial_year }}{% endif %}
+
+
+ +
+ {% include "ui/templates/components/workspace_switcher.html" %} + + {% if full_auth and (can_switch_service_tenant(current_user, ui_perms, ui_roles) or can_switch_service_branch(current_user, ui_perms, ui_roles) or can_switch_employee_tenant(current_user, ui_perms, ui_roles) or can_switch_employee_branch(current_user, ui_perms, ui_roles) or can_view_settings(current_user, ui_perms, ui_roles)) %} + {% if can_switch_service_tenant(current_user, ui_perms, ui_roles) or can_switch_employee_tenant(current_user, ui_perms, ui_roles) %} + {% set context_tenants = get_context_tenants(request, current_user, ui_perms, ui_roles) %} + + {% endif %} + + {% if can_switch_service_branch(current_user, ui_perms, ui_roles) or can_switch_employee_branch(current_user, ui_perms, ui_roles) %} + {% set context_branches = get_context_branches(request, current_user, ui_perms, ui_roles) %} + + {% endif %} + + {% if can_view_settings(current_user, ui_perms, ui_roles) %} + {% set context_financial_years = get_context_financial_years(request, current_user, ui_perms, ui_roles) %} + + {% endif %} + {% endif %} +
+ +
+ + Alerts + {% if unread_alert_count %}{{ unread_alert_count }}{% endif %} + + +
+ + {% if current_user_photo_url %} + Profile photo + {% else %} +
{{ current_user_initials }}
+ {% endif %} + +
+
+ {% if "Consultant" in ui_roles %} + My Profile + {% elif "Client" in ui_roles %} + My Profile + {% else %} + My Profile + {% endif %} + Change Password + Logout +
+
+
+
+
+
+
diff --git a/app/ui/templates/components/workspace_switcher.html b/app/ui/templates/components/workspace_switcher.html index 67bb5aa..62ccee4 100644 --- a/app/ui/templates/components/workspace_switcher.html +++ b/app/ui/templates/components/workspace_switcher.html @@ -3,19 +3,18 @@ {% set perms = ui_perms if ui_perms is defined else [] %} {% set current = current_path if current_path is defined else request.url.path %} {% set can_employee = ('Staff' in roles) or ('Employee' in roles) or ('employees.ess.view' in perms) or ('employees.work.view_self' in perms) or ('employees.attendance.view_self' in perms) or ('employees.leave.view_self' in perms) or ('employees.documents.view_self' in perms) or ('employees.payroll.view_self' in perms) %} -
+
- - {% if 'System Admin' in roles %}{% endif %} + {% if 'System Admin' in roles %}{% endif %} {% if 'Partner' in roles %}{% endif %} {% if 'Firm Admin' in roles %}{% endif %} {% if 'Manager' in roles or 'Branch Manager' in roles %}{% endif %} {% if can_employee %}{% endif %} {% if 'Client' in roles %}{% endif %} {% if 'Consultant' in roles %}{% endif %} - - All workspaces + All workspaces
{% endif %}