diff --git a/app/modules/employees/templates/employees/_my_workspace_tabs.html b/app/modules/employees/templates/employees/_my_workspace_tabs.html index bbdc683..2eb5671 100644 --- a/app/modules/employees/templates/employees/_my_workspace_tabs.html +++ b/app/modules/employees/templates/employees/_my_workspace_tabs.html @@ -1,38 +1,2 @@ -{% set current_path = request.url.path %} -{% set _tab_base = "inline-flex shrink-0 items-center rounded-xl px-3 py-2 text-sm font-semibold whitespace-nowrap transition" %} -{% set _tab_active = "bg-brand-600 text-white shadow-soft" %} -{% set _tab_idle = "border border-slate-300 bg-white text-slate-700 hover:bg-slate-50" %} -
-
My Workspace
-
-
- {% if can_view_employee_portal(current_user, current_user_permissions, current_user_roles) %} - Overview - {% endif %} - {% if can_view_own_employee_work(current_user, current_user_permissions, current_user_roles) %} - My Work Board - {% endif %} - {% if can_view_own_employee_attendance(current_user, current_user_permissions, current_user_roles) %} - My Attendance - {% endif %} - {% if can_view_employee_portal(current_user, current_user_permissions, current_user_roles) %} - My Profile - {% endif %} - {% if can_view_own_employee_leave(current_user, current_user_permissions, current_user_roles) %} - My Leave - {% endif %} - {% if can_view_own_employee_documents(current_user, current_user_permissions, current_user_roles) %} - My Documents - {% endif %} - {% if can_view_own_employee_payslips(current_user, current_user_permissions, current_user_roles) %} - My Payslips - {% endif %} - {% if can_request_own_employee_offboarding(current_user, current_user_permissions, current_user_roles) %} - My Offboarding - {% endif %} - - My Alert{% if unread_alert_count is defined and unread_alert_count > 0 %}{{ unread_alert_count }}{% endif %} - -
-
-
+{# UI/UX V2 Phase 1B — Staff pilot. Existing URLs and permission checks are preserved in the shared component. #} +{% include "ui/templates/components/staff_navigation_v2.html" %} diff --git a/app/modules/employees/templates/employees/portal_dashboard.html b/app/modules/employees/templates/employees/portal_dashboard.html index ebb3b6a..5265ff8 100644 --- a/app/modules/employees/templates/employees/portal_dashboard.html +++ b/app/modules/employees/templates/employees/portal_dashboard.html @@ -1,6 +1,7 @@ {% extends "ui/templates/base/layout.html" %} {% block content %}
+ {% include "ui/templates/components/staff_navigation_v2.html" %}
diff --git a/app/ui/templates/components/staff_navigation_v2.html b/app/ui/templates/components/staff_navigation_v2.html new file mode 100644 index 0000000..d69cef8 --- /dev/null +++ b/app/ui/templates/components/staff_navigation_v2.html @@ -0,0 +1,71 @@ +{# + UI/UX V2 Phase 1B — Staff pilot navigation + + This component deliberately reuses the existing employee self-service + permission helpers and URLs. It does not grant access, change routes, or + replace dashboard content tabs. +#} +{% set _staff_path = request.url.path %} +{% set navigation_aria_label_v2 = 'Staff workspace navigation' %} +{% set navigation_items_v2 = [ + { + 'label': 'Dashboard', + 'url': '/employee/dashboard', + 'visible': can_view_employee_portal(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path == '/employee/dashboard' + }, + { + 'label': 'Work', + 'url': '/employee/work', + 'visible': can_view_own_employee_work(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/work') + }, + { + 'label': 'Attendance', + 'url': '/employee/attendance', + 'visible': can_view_own_employee_attendance(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/attendance') + }, + { + 'label': 'Leave', + 'url': '/employee/leave', + 'visible': can_view_own_employee_leave(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/leave') + }, + { + 'label': 'Documents', + 'url': '/employee/documents', + 'visible': can_view_own_employee_documents(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/documents') + }, + { + 'label': 'Payslips', + 'url': '/employee/payslips', + 'visible': can_view_own_employee_payslips(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/payslips') + }, + { + 'label': 'Offboarding', + 'url': '/employee/offboarding', + 'visible': can_request_own_employee_offboarding(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/offboarding') + }, + { + 'label': 'Profile', + 'url': '/employee/profile', + 'visible': can_view_employee_portal(current_user, current_user_permissions, current_user_roles), + 'active': _staff_path.startswith('/employee/profile') + }, + { + 'label': 'Alerts', + 'url': '/alerts', + 'visible': true, + 'active': _staff_path.startswith('/alerts'), + 'badge': unread_alert_count if unread_alert_count is defined and unread_alert_count > 0 else none + } +] %} + +
+ {% include "ui/templates/components/navigation_v2.html" %} + {% include "ui/templates/components/mobile_navigation_v2.html" %} +