From 18a1a8d4f4d0490ba76882c3e8b7f0ed9196f4cb Mon Sep 17 00:00:00 2001 From: scmmishra Date: Wed, 6 Mar 2019 10:55:21 +0530 Subject: [PATCH] style: Fixed route.js --- erpnext/public/js/education/lms/routes.js | 161 +++++++++++----------- 1 file changed, 80 insertions(+), 81 deletions(-) diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js index 29ebd3a91b..657bc7aeb4 100644 --- a/erpnext/public/js/education/lms/routes.js +++ b/erpnext/public/js/education/lms/routes.js @@ -6,88 +6,87 @@ import ListPage from "./pages/ListPage.vue"; import ProfilePage from "./pages/ProfilePage.vue"; const routes = [{ - name: 'home', - path: '', - component: Home - }, - { - name: 'program', - path: '/Program/:program_name', - component: ProgramPage, - props: true - }, - { - name: 'course', - path: '/Program/:program_name/:course_name/', - component: CoursePage, - props: true, - }, - { - name: 'content', - path: '/Program/:program_name/:course_name/:topic/:type/:content', - component: ContentPage, - props: true, - beforeRouteUpdate (to, from, next) { - if (lms.store.checkProgramEnrollment(to.params.program_name)) { - next() - } else { - next({ - name: 'program', - params: { - program_name: to.params.program_name - } - }) - } - } - }, - { - name: 'list', - path: '/List/:master', - component: ListPage, - props: true - }, - { - name: 'signup', - path: '/Signup', - beforeEnter(to, from, next) { - window.location = window.location.origin.toString() + '/login#signup' - }, - component: Home, - props: true - }, - { - name: 'login', - path: '/Login', - beforeEnter(to, from, next) { - window.location = window.location.origin.toString() + '/login#login' - }, - component: Home, - props: true - }, - { - name: 'logout', - path: '/Logout', - beforeEnter(to, from, next) { - window.location = window.location.origin.toString() + '/?cmd=web_logout' - }, - component: Home, - props: true - }, - { - name: 'profile', - path: '/Profile', - component: ProfilePage, - props: true, - beforeEnter: (to, from, next) => { - if (!lms.store.checkLogin()) { - next({ - name: 'home' - }) - } else { - next() - } + name: 'home', + path: '', + component: Home +}, +{ + name: 'program', + path: '/Program/:program_name', + component: ProgramPage, + props: true +}, +{ + name: 'course', + path: '/Program/:program_name/:course_name/', + component: CoursePage, + props: true, +}, +{ + name: 'content', + path: '/Program/:program_name/:course_name/:topic/:type/:content', + component: ContentPage, + props: true, + beforeRouteUpdate (to, from, next) { + if (lms.store.checkProgramEnrollment(to.params.program_name)) { + next() + } else { + next({ + name: 'program', + params: { + program_name: to.params.program_name + } + }) } } -]; +}, +{ + name: 'list', + path: '/List/:master', + component: ListPage, + props: true +}, +{ + name: 'signup', + path: '/Signup', + beforeEnter(to, from, next) { + window.location = window.location.origin.toString() + '/login#signup' + }, + component: Home, + props: true +}, +{ + name: 'login', + path: '/Login', + beforeEnter(to, from, next) { + window.location = window.location.origin.toString() + '/login#login' + }, + component: Home, + props: true +}, +{ + name: 'logout', + path: '/Logout', + beforeEnter(to, from, next) { + window.location = window.location.origin.toString() + '/?cmd=web_logout' + }, + component: Home, + props: true +}, +{ + name: 'profile', + path: '/Profile', + component: ProfilePage, + props: true, + beforeEnter: (to, from, next) => { + if (!lms.store.checkLogin()) { + next({ + name: 'home' + }) + } else { + next() + } + } +}]; export default routes; \ No newline at end of file