Commit 4b5f28e0 by Fernando Martínez Santiago Committed by root

issue #630 closed

parent 01e39acb
...@@ -43,7 +43,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -43,7 +43,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
free_category_coord_y: null, free_category_coord_y: null,
status: 'invisible', status: 'invisible',
highlight: false, highlight: false,
color: null color: null,
expression: null
} }
}; };
$scope.showFreeCategory = !$scope.studentData.attributes.categories; $scope.showFreeCategory = !$scope.studentData.attributes.categories;
......
...@@ -15,6 +15,8 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -15,6 +15,8 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
$scope.studentPicto = studentPicto; $scope.studentPicto = studentPicto;
// Input expression // Input expression
$scope.expression = (studentPicto.expression != undefined) ? studentPicto.expression.text : ''; $scope.expression = (studentPicto.expression != undefined) ? studentPicto.expression.text : '';
if ($scope.studentPicto.attributes.expression==undefined || $scope.studentPicto.attributes.expression==null)
$scope.studentPicto.attributes.expression=studentPicto.expression.text;
// Enable or Disable the button 'change' if the supervisor is the owner of the picto // Enable or Disable the button 'change' if the supervisor is the owner of the picto
$scope.isOwner = (studentPicto.picto.owner == sup.id) ? true : false; $scope.isOwner = (studentPicto.picto.owner == sup.id) ? true : false;
...@@ -39,7 +41,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -39,7 +41,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
io.socket.post('/stu/vocabulary', { io.socket.post('/stu/vocabulary', {
action: 'update', action: 'update',
attributes: { attributes: {
id_stu: student.id, id_stu: $scope.stu.id,
stu_picto: studentPicto.id stu_picto: studentPicto.id
} }
}, function () {}); }, function () {});
...@@ -67,7 +69,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta ...@@ -67,7 +69,7 @@ dashboardControllers.controller('PictoConfigCtrl', function ($scope, $modalInsta
action: 'update', action: 'update',
attributes: { attributes: {
id_stu: $scope.stu.id, id_stu: $scope.stu.id,
picto: data stu_picto: data
} }
}, },
function(res) { function(res) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
('empty-' + $index + '-' + $parent.$index) ('empty-' + $index + '-' + $parent.$index)
}}" }}"
draggable droppable drop="handleDrop" draggable droppable drop="handleDrop"
popover="{{studentPicto.expression.text}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<img <img
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<div <div
class="picto pull-left" class="picto pull-left"
ng-repeat="studentPicto in studentPictoRow track by $index" ng-repeat="studentPicto in studentPictoRow track by $index"
popover="{{studentPicto.expression.text}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter"> popover-trigger="mouseenter">
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
('empty-' + $index + '-' + $parent.$index) ('empty-' + $index + '-' + $parent.$index)
}}" }}"
draggable droppable drop="handleDrop" draggable droppable drop="handleDrop"
popover="{{studentPicto.expression.text}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<img <img
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<form ng-submit="isOwner ? change() : update_properties()"> <form ng-submit="isOwner ? change() : update_properties()">
<div id="add_label" class="input-group"> <div id="add_label" class="input-group">
<span class="input-group-addon glyphicon glyphicon-comment" aria-hidden="true"></span> <span class="input-group-addon glyphicon glyphicon-comment" aria-hidden="true"></span>
<input type="text" class="form-control" ng-model="isOwner ? expression : studentPicto.attributes.expression" /> <input type="text" class="form-control" ng-if="isOwner" ng-model="expression" />
<input type="text" class="form-control" ng-if="!isOwner" ng-model="studentPicto.attributes.expression" />
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-success" type="submit" translate>save</button> <button class="btn btn-success" type="submit" translate>save</button>
</span> </span>
......
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