Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
288b6ee8
authored
Apr 06, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue
#129
fixed
parent
77ae9311
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
sails/src/api/controllers/PictoController.js
sails/src/api/models/Student.js
sails/src/assets/scripts/modules/student/controllers/addpicto.js
sails/src/config/routes.js
sails/src/api/controllers/PictoController.js
View file @
288b6ee8
This diff is collapsed.
Click to expand it.
sails/src/api/models/Student.js
View file @
288b6ee8
...
...
@@ -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
);
...
...
sails/src/assets/scripts/modules/student/controllers/addpicto.js
View file @
288b6ee8
...
...
@@ -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
;
...
...
sails/src/config/routes.js
View file @
288b6ee8
...
...
@@ -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'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment