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
89225832
authored
Apr 22, 2017
by
Jose Antonio
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix create scene and showing pictos
parent
1754391f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
sails/src/api/controllers/SceneController.js
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/api/controllers/SceneController.js
View file @
89225832
...
...
@@ -23,12 +23,12 @@ module.exports = {
student
:
params
.
id_stu
}).
then
(
scene
=>
{
if
(
scene
.
categories
){
Model
.
query
(
'CALL scene_create_core('
+
scene
.
id
+
','
+
scene
.
student
+
') '
,
function
(
err
,
result
)
{
if
(
err
)
{
return
res
.
serverError
(
"Could not call stored procedure create scene picto core "
+
err
);
}
else
{
return
res
.
ok
(
scene
);
}
Scene
.
query
(
'CALL scene_create_core(?,?) '
,[
scene
.
id
,
scene
.
student
]
,
function
(
err
,
result
)
{
//
if (err) {
//
return res.serverError("Could not call stored procedure create scene picto core "+err);
//
} else {
//
return res.ok(scene);
//
}
});
}
return
res
.
ok
(
scene
);
...
...
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
89225832
...
...
@@ -123,7 +123,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}
};
// get active scene
// get a
nd show a
ctive scene
$scope
.
showActiveScene
=
function
(
scene
)
{
$scope
.
loadingPictos
=
true
;
$scope
.
freeCategoryPictos
=
$scope
.
freeCategoryPictos
||
generateGrid
();
...
...
@@ -145,12 +145,14 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
});
};
//
get active scene
//
Get a scene and show it
$scope
.
showScene
=
function
(
idScene
)
{
$scope
.
loadingPictos
=
true
;
$scope
.
freeCategoryPictos
=
$scope
.
freeCategoryPictos
||
generateGrid
();
$scope
.
studentPictos
[
$scope
.
getCategoryId
(
$scope
.
selectedCategory
)]
=
$scope
.
studentPictos
[
$scope
.
getCategoryId
(
$scope
.
selectedCategory
)]
||
generateGrid
();
//$scope.freeCategoryPictos = $scope.freeCategoryPictos || generateGrid();
// $scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] =
// $scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] || generateGrid();
$scope
.
freeCategoryPictos
=
generateGrid
();
$scope
.
studentPictos
[
$scope
.
getCategoryId
(
$scope
.
selectedCategory
)]
=
generateGrid
();
$http
.
get
(
config
.
backend
+
'/scene/'
+
idScene
)
.
success
(
function
(
scene
)
{
...
...
@@ -167,7 +169,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
});
};
//
get active scene
//
Load the scene list
$scope
.
loadScenesList
=
function
()
{
$http
.
get
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/scenes'
)
...
...
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