unserver-unify
Version:
637 lines • 19.1 kB
JavaScript
angular.module('bamboo.course', ['ui.router']).config(function($logProvider) {
$logProvider.debugEnabled(true);
}).config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$stateProvider.state('index.courses', {
url: "/courselist/:type?share",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory, loginService) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilelist.html';
} else if (loginService.subDomain == 'gsx') {
url = 'app/course/gsx/list.html';
} else if (loginService.school.courseCateImage) {
url = 'app/course/categorylist.html';
} else if (loginService.school.theme) {
switch (loginService.school.theme) {
case 't1':
url = 'app/course/list_v1.html';
break;
case 't6':
url = 'app/course/list_t6.html';
break;
case 't8':
url = 'app/course/list_t8.html';
break;
default:
url = 'app/course/list.html';
break;
}
} else {
url = 'app/course/list.html';
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/list.html'
}
},
ncyBreadcrumb: {
label: 'Courses'
},
//accessLevel: //accessLevels.users
}).state('index.corsegrade', {
url: "/grade",
views: {
"@index": {
templateUrl: 'app/course/class_grade.html'
}
},
ncyBreadcrumb: {
label: 'Grade'
},
//accessLevel: //accessLevels.users
}).state('index.gsxcourses', {
url: "/gsxcourselist/:tab",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory, loginService) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilelist.html';
} else if (loginService.school.theme) {
switch (loginService.school.theme) {
case 't1':
url = 'app/course/list_v1.html';
break;
default:
url = 'app/course/list.html';
break;
}
} else {
url = 'app/course/list.html';
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/list.html'
}
},
ncyBreadcrumb: {
label: 'Courses'
},
//accessLevel: //accessLevels.users
}).state('index.categorylist', {
url: "/:category/categorylist",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilecategory_courselist.html';
} else {
url = 'app/course/category_courselist.html';
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/list.html'
}
},
ncyBreadcrumb: {
label: 'Courses'
},
//accessLevel: //accessLevels.users
/* }).state('index.courseposition', {
url: "/position",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory, loginService) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilepositionlist.html';
} else {
url = 'app/course/positionlist.html';
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/list.html'
}
},
ncyBreadcrumb: {
label: 'Position'
},
//accessLevel: //accessLevels.users*/
}).state('index.cmeccourses', {
url: "/courselistcmec/:key",
views: {
"@index": {
templateUrl: 'app/course/cmeclist.html'
}
},
ncyBreadcrumb: {
label: 'Genaral Courses'
},
//accessLevel: //accessLevels.users
}).state('index.searchcourse', {
url: "/coursesearch/:type/:key",
views: {
"@index": {
//templateUrl: 'app/course/search.html'
templateProvider: function(deviceDetector, $templateFactory, $stateParams, loginService) {
console.log($stateParams);
var url = 'app/course/search.html';
if (loginService.subDomain == 'gsx') {
url = 'app/course/gsx/search.html'
}
if ($stateParams.type == 'pre-book' && loginService.subDomain != 'gsx') {
url = 'app/cfcourse/cfsearch.html'
}
if ($stateParams.type == 'pre-book' && loginService.subDomain == 'gsx') {
url = 'app/cfcourse/gsx/cfsearch.html'
}
if ($stateParams.type == 'offline' && loginService.subDomain != 'gsx') {
url = 'app/ofcourse/gsxoffcoursessearchlist.html'
}
if ($stateParams.type == 'offline' && loginService.subDomain == 'gsx') {
url = 'app/ofcourse/gsx/gsxoffcoursessearchlist.html'
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: 'Course Search'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course', {
url: "/course/:cid/:cs?share",
params: {
courseParam: null
},
views: {
"@index": {
// templateUrl: 'app/course/home.html'
templateProvider: function(deviceDetector, $templateFactory, $stateParams, loginService) {
console.log($stateParams);
var url = 'app/course/home.html';
if (loginService.subDomain == 'arg') {
url = 'app/course/arg/course_home.html'
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: '{{lcoursename||"Courses"}}'
},
data: {
permissions: {
only: ['login'],
redirectTo: '403',
}
}
//accessLevel: //accessLevels.users
}).state('index.courses.course.contents', {
url: "/contents",
views: {
"@index": {
templateUrl: 'app/course/home.html'
}
},
ncyBreadcrumb: {
label: 'Contents'
}
}).state('index.courses.course.teachers', {
url: "/teachers",
views: {
"@index": {
templateUrl: 'app/course/home.html'
}
},
ncyBreadcrumb: {
label: 'Teachers'
}
}).state('index.courses.course.courseinfo', {
url: "/courseinfo",
views: {
"@index": {
templateUrl: 'app/course/home.html'
}
},
ncyBreadcrumb: {
label: 'Course Information'
}
}).state('index.courses.course.relatedcourse', {
url: "/relatedcourse",
views: {
"@index": {
templateUrl: 'app/course/home.html'
}
},
ncyBreadcrumb: {
label: 'Related Course'
}
}).state('index.courses.course.progress', {
url: "/progress",
views: {
"@index": {
templateUrl: 'app/course/home.html'
}
},
ncyBreadcrumb: {
label: 'progress'
}
}).state('index.courses.course.result', {
url: "/result",
views: {
"@index": {
templateUrl: 'app/course/result.html'
}
},
ncyBreadcrumb: {
label: 'Result'
},
//accessLevel: //accessLevels.users
// }).state('index.courses.course.mycourse', {
// url: "/mycourse",
// views: {
// "@index": {
// templateUrl: 'app/course/mycourse.html'
// }
// },
// ncyBreadcrumb: {
// label: 'My Course'
// },
//accessLevel: //accessLevels.users
}).state('index.courses.course.result.errorbank', {
url: "/errorbank",
views: {
"@index": {
templateUrl: 'app/course/errorbank.html'
}
},
ncyBreadcrumb: {
label: 'Error Bank'
},
}).state('index.courses.course.knowledges', {
url: "/knowledges/:pid",
views: {
"@index": {
templateProvider: function($templateFactory, loginService) {
var url = 'app/course/knowledge/knowledges.html';
if (loginService.school.knowledgeFolder) {
url = 'app/course/knowledge/knowledgescate.html';
}
return $templateFactory.fromUrl(url);
}
}
},
ncyBreadcrumb: {
label: 'Knowledge Level'
},
}).state('index.courses.course.practice', {
url: "/knowledgespractice",
views: {
"@index": {
templateProvider: function($templateFactory) {
var url = 'app/course/knowledge/practice.html';
return $templateFactory.fromUrl(url);
}
}
},
ncyBreadcrumb: {
label: 'Knowledge Practice'
},
}).state('index.courses.course.knowledgetest', {
url: "/ktest/:pid",
views: {
"@index": {
templateUrl: 'app/course/knowledge/knowledges.html'
}
// "@index": {
// templateProvider: function($templateFactory, loginService) {
// var url = 'app/course/knowledge/knowledges.html';
// if (loginService.school.knowledgeFolder) {
// url = 'app/course/knowledge/knowledgescate.html';
// }
// return $templateFactory.fromUrl(url);
// }
// }
},
ncyBreadcrumb: {
label: 'Knowledge Level'
},
}).state('index.courses.course.knowledgetest.resources', {
url: "/resources/:key",
views: {
"@index": {
templateUrl: 'app/course/knowledge/resources.html'
}
},
ncyBreadcrumb: {
label: 'Resources'
},
}).state('index.courses.course.knowledges.resources', {
url: "/resources/:key",
views: {
"@index": {
templateUrl: 'app/course/knowledge/resources.html'
}
},
ncyBreadcrumb: {
label: 'Resources'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section', {
url: "/:id",
views: {
"@index": {
templateUrl: 'app/course/header.html'
}
},
ncyBreadcrumb: {
skip: true
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1', {
url: "/v1/:id",
views: {
"@index": {
templateUrl: 'app/course/morepagesv1.html'
}
},
ncyBreadcrumb: {
skip: true
},
//accessLevel: //accessLevels.users
}).state('index.courses.info', {
url: "/info/:cid",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory, loginService) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobileinfo.html';
} else {
url = 'app/course/info.html';
if (loginService.subDomain === 'arg') {
url = 'app/course/arg/course_home_info.html';
// url = 'app/course/info.html';
}
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/info.html'
}
},
ncyBreadcrumb: {
label: '{{lcoursename||"Courseware"}}'
},
//accessLevel: //accessLevels.users
}).state('index.courses.infoonly', {
url: "/infoonly/:cid",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobileinfoonly.html';
} else {
url = 'app/course/infoonly.html';
}
return $templateFactory.fromUrl(url);
},
//templateUrl: 'app/course/infoonly.html'
}
},
ncyBreadcrumb: {
label: '{{lcoursename||"Information"}}'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.video', {
url: "/video/:rid/:shownote",
views: {
"@index.courses.course.section": {
//templateUrl: 'app/course/video.html'
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobile_video.html';
} else {
url = 'app/course/videohome.html';
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: '{{subjectname||"Courseware"}}'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.discuss', {
url: "/discuss/:tid",
views: {
"@index.courses.course.section": {
// templateUrl: 'app/course/discuss.html'
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilediscuss.html';
} else {
url = 'app/course/discuss.html';
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: 'Discussion'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.discuss', {
url: "/discuss/:tid",
views: {
"@index.courses.course.sectionv1": {
// templateUrl: 'app/course/discuss.html'
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobilediscuss.html';
} else {
url = 'app/course/discuss.html';
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: 'Discussion'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.note', {
url: "/note",
views: {
"@index.courses.course.section": {
templateUrl: 'app/course/note.html'
}
},
ncyBreadcrumb: {
label: 'Notes'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.note', {
url: "/note",
views: {
"@index.courses.course.sectionv1": {
templateUrl: 'app/course/note.html'
}
},
ncyBreadcrumb: {
label: 'Notes'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.exam', {
url: "/exam",
views: {
"@index.courses.course.section": {
templateUrl: 'app/course/exams.html'
}
},
ncyBreadcrumb: {
label: 'Exams'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.exam', {
url: "/exam",
views: {
"@index.courses.course.sectionv1": {
templateUrl: 'app/course/exams.html'
}
},
ncyBreadcrumb: {
label: 'Exams'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.exam.assignment', {
url: "/assignment/:aid",
views: {
"@index.courses.course.section": {
// templateUrl: 'app/course/assignment.html'
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobile_assignment.html';
} else {
url = 'app/course/assignment.html';
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: 'Assignment'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.exam.assignment', {
url: "/assignment/:aid",
views: {
"@index.courses.course.sectionv1": {
// templateUrl: 'app/course/assignment.html'
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/mobile_assignment.html';
} else {
url = 'app/course/assignment.html';
}
return $templateFactory.fromUrl(url);
},
}
},
ncyBreadcrumb: {
label: 'Assignment'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.doc', {
url: "/doc",
views: {
"@index.courses.course.section": {
templateUrl: 'app/course/docs.html'
}
},
ncyBreadcrumb: {
label: 'Exams'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.doc', {
url: "/doc",
views: {
"@index.courses.course.sectionv1": {
templateUrl: 'app/course/docs.html'
}
},
ncyBreadcrumb: {
label: 'Exams'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.wikiware', {
url: "/wikiware",
views: {
"@index.courses.course.section": {
templateUrl: 'app/course/courseware.html'
}
},
ncyBreadcrumb: {
label: 'Courseware'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.sectionv1.wikiware', {
url: "/wikiware",
views: {
"@index.courses.course.sectionv1": {
templateUrl: 'app/course/courseware.html'
}
},
ncyBreadcrumb: {
label: 'Courseware'
},
//accessLevel: //accessLevels.users
}).state('index.courses.course.section.summary', {
url: "/summary",
views: {
"@index.courses.course.section": {
templateUrl: 'app/course/summary.html'
}
},
ncyBreadcrumb: {
label: 'Summary'
}
}).state('index.catecourses', {
url: "/catecourses/:type?share",
views: {
"@index": {
templateProvider: function(deviceDetector, $templateFactory) {
var url = '';
if (deviceDetector.isMobile() && !deviceDetector.isTablet()) {
url = 'app/course/categorylist.html';
} else {
url = 'app/course/categorylist.html';
}
return $templateFactory.fromUrl(url);
}
}
},
ncyBreadcrumb: {
label: 'Courses'
}
}).state('index.courses.course.result.errorfullpaper', {
url: "/errorfullpaper",
views: {
"@index": {
templateUrl: 'app/course/errorfullpaper.html'
}
},
ncyBreadcrumb: {
label: 'Preview'
},
});
}]);