- add all AppSidebar links that used
- add singup form
This commit is contained in:
Alexandrina-Kuzeleva
2025-11-10 12:27:28 +03:00
parent 7a47591967
commit 0cb8d21290
3 changed files with 148 additions and 23 deletions

View File

@@ -659,6 +659,106 @@ const setUpOnboarding = () => {
}
}
const addMyPoints = () => {
const roles = userResource.data?.roles || []
if (roles.includes('LMS Student') || roles.includes('LMS Schoolchild')) {
sidebarLinks.value.push({
label: __('My points'),
icon: 'Award',
to: 'my_points',
external: true,
activeFor: [],
})
}
}
const addLeaderBoard = () => {
if (user) {
sidebarLinks.value.push({
label: __('Leader Board'),
icon: 'Trophy',
to: 'leaderboardsample',
external: true,
activeFor: [],
})
}
}
const addChatGPT = () => {
const roles = userResource.data?.roles || []
let URL = ''
let nameLabel = ''
if (roles.includes('LMS Schoolchild') || roles.includes('LMS Student') || roles.includes('Course Creator')) {
if (roles.includes('LMS Schoolchild')) {
URL = 'chatgpt-schoolchild'
nameLabel = __('ChatGPT for Schoolers')
} else if (roles.includes('LMS Student')) {
URL = 'chatgpt-schoolchild'
nameLabel = __('ChatGPT for Students')
} else if (roles.includes('Course Creator')) {
URL = 'ai-teachers'
nameLabel = __('ChatGPT for Teachers')
}
sidebarLinks.value.push({
label: nameLabel,
icon: 'Cpu',
to: URL,
external: true,
activeFor: [],
})
}
}
const addMyChild = () => {
const roles = userResource.data?.roles || []
if (roles.includes('Parent')) {
sidebarLinks.value.push({
label: __('My Child'),
icon: 'User',
to: 'my-child',
activeFor: [],
external: true,
})
}
}
//test of new page
const addProfile = () => {
const roles = userResource.data?.roles || []
if (roles.includes('LMS Student')) {
sidebarLinks.value.push({
label: __('Student Profile'),
icon: 'Home',
to: 'StudentProfile',
activeFor: [],
})
} else if (roles.includes('LMS Schoolchild')) {
sidebarLinks.value.push({
label: __('Schoolchildren Profile'),
icon: 'Home',
to: 'SchoolchildrenProfile',
activeFor: [],
})
} else if (roles.includes('Course Creator')) {
sidebarLinks.value.push({
label: __('Course Creator Profile'),
icon: 'Home',
to: 'CourseCreatorProfile',
activeFor: [],
})
} else {
sidebarLinks.value.push({
label: __('Parent Profile'),
icon: 'Home',
to: 'ParentProfile',
activeFor: [],
})
}
}
watch(userResource, () => {
addContactUsDetails()
if (userResource.data) {
@@ -670,6 +770,12 @@ watch(userResource, () => {
addQuizzes()
addAssignments()
setUpOnboarding()
addMyPoints()
addLeaderBoard()
addChatGPT()
addMyChild()
addProfile()
}
})