Group staff navigation using existing navigation structure
This commit is contained in:
@@ -27,46 +27,80 @@
|
|||||||
'active': _staff_path.startswith('/employee/work')
|
'active': _staff_path.startswith('/employee/work')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'label': 'Attendance',
|
'label': 'Attendance & Leave',
|
||||||
'url': '/employee/attendance',
|
'visible': (
|
||||||
'visible': can_view_own_employee_attendance(current_user, current_user_permissions, current_user_roles),
|
can_view_own_employee_attendance(current_user, current_user_permissions, current_user_roles)
|
||||||
'active': _staff_path.startswith('/employee/attendance')
|
or can_view_own_employee_leave(current_user, current_user_permissions, current_user_roles)
|
||||||
|
),
|
||||||
|
'active': _staff_path.startswith('/employee/attendance') or _staff_path.startswith('/employee/leave'),
|
||||||
|
'children': [
|
||||||
|
{
|
||||||
|
'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': 'Leave',
|
'label': 'Profile & HR',
|
||||||
'url': '/employee/leave',
|
'visible': (
|
||||||
'visible': can_view_own_employee_leave(current_user, current_user_permissions, current_user_roles),
|
can_view_employee_portal(current_user, current_user_permissions, current_user_roles)
|
||||||
'active': _staff_path.startswith('/employee/leave')
|
or can_view_own_employee_documents(current_user, current_user_permissions, current_user_roles)
|
||||||
|
or can_view_own_employee_payslips(current_user, current_user_permissions, current_user_roles)
|
||||||
|
or can_request_own_employee_offboarding(current_user, current_user_permissions, current_user_roles)
|
||||||
|
),
|
||||||
|
'active': (
|
||||||
|
_staff_path.startswith('/employee/profile')
|
||||||
|
or _staff_path.startswith('/employee/documents')
|
||||||
|
or _staff_path.startswith('/employee/payslips')
|
||||||
|
or _staff_path.startswith('/employee/offboarding')
|
||||||
|
),
|
||||||
|
'children': [
|
||||||
|
{
|
||||||
|
'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': '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': 'Documents',
|
'label': 'Tools',
|
||||||
'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': 'Bank Analyzer',
|
|
||||||
'url': '/tools/bank-statement-analyzer',
|
|
||||||
'visible': true,
|
'visible': true,
|
||||||
'active': _staff_path.startswith('/tools/bank-statement-analyzer')
|
'active': _staff_path.startswith('/tools/bank-statement-analyzer'),
|
||||||
|
'children': [
|
||||||
|
{
|
||||||
|
'label': 'Bank Analyzer',
|
||||||
|
'url': '/tools/bank-statement-analyzer',
|
||||||
|
'visible': true,
|
||||||
|
'active': _staff_path.startswith('/tools/bank-statement-analyzer')
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'label': 'Alerts',
|
'label': 'Alerts',
|
||||||
|
|||||||
Reference in New Issue
Block a user