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

issue #630 closed

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