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
4ba9dd64
authored
Dec 10, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #676 fixed
parent
9a113ef3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
sails/src/api/controllers/PictoController.js
sails/src/api/models/Supervisor.js
sails/src/assets/scripts/modules/student/controllers/addpicto.js
sails/src/api/controllers/PictoController.js
View file @
4ba9dd64
...
...
@@ -79,6 +79,10 @@ module.exports = {
var
l
=
[];
var
fs
=
require
(
'fs'
);
// return empty for category 0 (that represents category pictos and all custom pictos)
if
(
req
.
params
.
id_cat
==
0
)
return
res
.
ok
(
l
);
Supervisor
.
findOne
({
id
:
req
.
params
.
id
}).
then
(
function
(
supervisor
)
{
if
(
supervisor
)
{
Picto
.
find
({
category
:
req
.
params
.
id_cat
})
...
...
@@ -103,12 +107,12 @@ module.exports = {
function
(
err
)
{
// loop has end
if
(
err
)
throw
err
;
sails
.
log
.
debug
(
pictos
.
length
+
" pictos sent for category "
+
req
.
params
.
id_cat
+
" in language "
+
supervisor
.
lang
);
res
.
ok
(
l
);
re
turn
re
s
.
ok
(
l
);
});
// end async.eachSeries
})
.
catch
(()
=>
res
.
badRequest
());
}
else
{
res
.
badRequest
();
re
turn
re
s
.
badRequest
();
}
})
.
catch
(()
=>
res
.
serverError
());
...
...
sails/src/api/models/Supervisor.js
View file @
4ba9dd64
/* global Supervisor, sails */
const
lodash
=
require
(
'lodash'
);
/**
* supervisor.js
...
...
sails/src/assets/scripts/modules/student/controllers/addpicto.js
View file @
4ba9dd64
...
...
@@ -63,7 +63,6 @@ dashboardControllers.controller('AddPictoCtrl', function (
//
// Load pictos from owned by the actual supervisor
// TEST --> change with real supervisor pictos
//
$scope
.
load_own_pictos
=
function
()
{
$scope
.
source
=
'ownpictos'
;
...
...
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