issue #129 fixed

parent 77ae9311
......@@ -591,7 +591,7 @@ module.exports = {
PictoExp.findOne({id_pic: sp.picto.id, lang: sp.student.lang})
.then(pe => {
if (typeof sp.attributes.expression == 'undefined' || sp.attributes.expression == null)
sp.attributes.expression = pe.text;
sp.attributes.expression = pe.text;
sp.student = sp.student.id;
delete sp.picto.expressions;
cb(null,sp);
......
......@@ -51,10 +51,10 @@ dashboardControllers.controller('AddPictoCtrl', function (
var request = "";
if(categoryId == 0){
//Request page X from all pictos (symbolstx)
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromSymbolStx/page/'+$scope.page+'/limit/'+$scope.limit;
}else{
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromCatSubcat/category/'+categoryId+'/page/'+$scope.page+'/limit/'+$scope.limit;
}
$http.get(request)
......@@ -96,7 +96,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
var request = "";
//Request page X from all pictos (symbolstx)
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromArasaac/page/'+$scope.page+'/limit/'+$scope.limit;
$http.get(request)
......@@ -142,7 +142,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
//
$scope.load_category = function (categoryId){
$scope.page = 1;
$http.get(config.backend+'/sup/'+ supervisor.id +'/pic_categories/' + categoryId)
$http.get(config.backend + '/picto/' + student.lang + '/pic_categories/' + categoryId)
.success(function(data, status, headers, config) {
// Add to list
if (data && $scope.source == 'symbolstx'){
......@@ -335,16 +335,16 @@ dashboardControllers.controller('AddPictoCtrl', function (
if($scope.source == "symbolstx"){
if($scope.breadcrumbs.length == 1) {
//Request page X from all pictos (symbolstx)
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromSymbolStx/page/'+$scope.page+'/limit/'+$scope.limit;
}else{
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromCatSubcat/category/'+$scope.breadcrumbs[$scope.breadcrumbs.length-1].id
+'/page/'+$scope.page+'/limit/'+$scope.limit;
}
}else if($scope.source == "arasaac"){
//Request page X from all pictos (symbolstx)
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang +
'/pic_fromArasaac/page/'+$scope.page+'/limit/'+$scope.limit;
}
......@@ -399,7 +399,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
}else if($scope.source == "arasaac"){
source = 3;
}
request = config.backend + '/sup/' + supervisor.id +
request = config.backend + '/picto/' + student.lang + '/' + supervisor.id +
'/pic_fromSearch/'+$scope.srch_term_picto+'/category/'+category+
'/source/'+source;
......
......@@ -59,6 +59,13 @@ module.exports.routes = {
'GET /office/get/:id': 'OfficeController.get',
'GET /office/get/:id/supervisors': 'OfficeController.supervisors',
'GET /picto/:lang/pic_categories/:id_cat': 'PictoController.categories',
'GET /picto/:lang/pic_fromcategory/:id_cat': 'PictoController.fromcategory',
'GET /picto/:lang/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx',
'GET /picto/:lang/pic_fromArasaac/page/:page/limit/:limit': 'PictoController.fromArasaac',
'GET /picto/:lang/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat',
'GET /picto/:lang/:id_sup/pic_fromSearch/:text/category/:id_cat/source/:source': 'PictoController.fromSearch',
'POST /picto/upload': 'PictoController.upload',
'POST /picto/tag': 'PictoController.add_tag',
'POST /picto/exp': 'PictoController.change_exp',
......@@ -74,6 +81,7 @@ module.exports.routes = {
'GET /stu/:id_stu/tutors': 'StudentController.tutors',
'POST /stu/:id_stu/sup/:id_sup': 'StudentController.link_supervisor',
'GET /stu/:id_stu/pictos': 'StudentController.pictos',
'GET /stu/:id_stu/methods': 'StudentController.methods',
'GET /stu/:id_stu/lasttries': 'StudentController.lasttries',
'GET /stu/:id_stu/tries': 'StudentController.tries',
......@@ -105,12 +113,7 @@ module.exports.routes = {
'GET /sup/all': 'SupervisorController.list',
'GET /sup/:id/students': 'SupervisorController.students',
'GET /sup/:id/pictos': 'SupervisorController.pictos',
'GET /sup/:id/pic_categories/:id_cat': 'PictoController.categories',
'GET /sup/:id/pic_fromcategory/:id_cat': 'PictoController.fromcategory',
'GET /sup/:id/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx',
'GET /sup/:id/pic_fromArasaac/page/:page/limit/:limit': 'PictoController.fromArasaac',
'GET /sup/:id/pic_fromCatSubcat/category/:id_cat/page/:page/limit/:limit': 'PictoController.fromCatSubcat',
'GET /sup/:id/pic_fromSearch/:text/category/:id_cat/source/:source': 'PictoController.fromSearch',
'GET /sup/email/:email': 'SupervisorController.getByEmail',
'GET /sup/changepass/:email': 'SupervisorController.request_change_password',
'GET /sup/arasaac_license/:id': 'SupervisorController.accept_arasaac',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment