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
6bab22da
authored
Dec 16, 2016
by
root
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #666 closed (lectoescritura)
parent
c516233a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
5 deletions
sails/src/api/controllers/StudentController.js
sails/src/assets/scripts/modules/student/controllers/pictoconfig.js
sails/src/assets/scripts/modules/student/views/pictoconfig.html
sails/src/config/policies.js
sails/src/config/routes.js
sails/src/api/controllers/StudentController.js
View file @
6bab22da
This diff is collapsed.
Click to expand it.
sails/src/assets/scripts/modules/student/controllers/pictoconfig.js
View file @
6bab22da
...
...
@@ -3,7 +3,7 @@
// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.
dashboardControllers
.
controller
(
'PictoConfigCtrl'
,
function
(
$scope
,
$modalInstance
,
$http
,
config
,
studentPicto
,
sup
,
stu
)
{
dashboardControllers
.
controller
(
'PictoConfigCtrl'
,
function
(
$
window
,
$
scope
,
$modalInstance
,
$http
,
config
,
studentPicto
,
sup
,
stu
)
{
// Last parameter passed from collections.js
// Basic data passed from the main window
...
...
@@ -34,7 +34,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console
.
log
(
"Expression changed: "
+
JSON
.
stringify
(
data
)
+
": "
+
$scope
.
studentPicto
.
expression
.
text
);
$scope
.
studentPicto
.
attributes
.
expression
=
$scope
.
studentPicto
.
expression
.
text
;
// Close the modal instance
$modalInstance
.
close
(
$scope
.
studentPicto
.
expression
.
text
);
//
$modalInstance.close($scope.studentPicto.expression.text);
// Notifcar cambio
io
.
socket
.
post
(
'/stu/vocabulary'
,
{
...
...
@@ -70,7 +70,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
console
.
log
(
"Properties updated"
);
// Close the modal instance
$modalInstance
.
close
(
$scope
.
expression
);
//
$modalInstance.close($scope.expression);
// /////////////////////////////////////////////////////////////
// Websocket: Emit vocabulary update action
...
...
@@ -92,6 +92,21 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
});
};
$scope
.
update_legend
=
function
(){
console
.
log
(
"Legend: "
+
$scope
.
studentPicto
.
attributes
.
legend
+
" to be modified"
);
$http
.
put
(
config
.
backend
+
'/stu/'
+
$scope
.
stu
.
id
+
'/legend/'
+
$scope
.
studentPicto
.
attributes
.
legend
)
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Legend updated"
);
// Close the modal instance
$modalInstance
.
close
(
$scope
.
expression
);
$window
.
location
.
reload
();
});
};
$scope
.
close
=
function
()
{
// Lo que se devuelve a collection
$modalInstance
.
dismiss
(
'cancel'
);
...
...
sails/src/assets/scripts/modules/student/views/pictoconfig.html
View file @
6bab22da
...
...
@@ -62,12 +62,12 @@
<hr>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<input
type=
"checkbox"
>
<input
type=
"checkbox"
ng-model=
"update_all_legend"
ng-init=
"update_all_legend=false"
>
<span
translate
>
legend_apply_all
</span>
</div>
<div
class=
"col-md-4"
>
<div
class=
"form-group text-center"
>
<button
type=
"submit"
class=
"btn btn-primary ng-scope"
ng-click=
"
"
disabled
translate
>
apply
</button>
<button
type=
"submit"
class=
"btn btn-primary ng-scope"
ng-click=
"
update_all_legend ? update_legend() : close()"
translate
>
apply
</button>
</div>
</div>
</div>
...
...
sails/src/config/policies.js
View file @
6bab22da
...
...
@@ -96,6 +96,7 @@ module.exports.policies = {
ws
:
[
'tokenAuth'
],
update
:
[
'tokenAuth'
],
update_picto
:
[
'tokenAuth'
,
'isSupervisorOfStudent'
],
update_legend
:
[
'tokenAuth'
],
login
:
true
,
create
:
[
'tokenAuth'
],
upload
:
[
'tokenAuth'
],
...
...
sails/src/config/routes.js
View file @
6bab22da
...
...
@@ -81,6 +81,7 @@ module.exports.routes = {
'GET /stu/:id_stu/ws'
:
'StudentController.ws'
,
'PUT /stu/:id_stu'
:
'StudentController.update'
,
'PUT /stu/:id_stu/picto/:id_stuPicto'
:
'StudentController.update_picto'
,
'PUT /stu/:id_stu/legend/:legend_value'
:
'StudentController.update_legend'
,
'PUT /stu/:id_stu/picto'
:
'StudentController.update_picto'
,
'POST /stu/login'
:
'StudentController.login'
,
'POST /stu'
:
'StudentController.create'
,
...
...
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