Commit c8310968 by Arturo Montejo Ráez

Merge branch 'issue627' into develop

parents 4b5f28e0 25bfb99e
...@@ -20,6 +20,8 @@ TRUNCATE method; ...@@ -20,6 +20,8 @@ TRUNCATE method;
TRUNCATE instruction; TRUNCATE instruction;
TRUNCATE try; TRUNCATE try;
TRUNCATE working_session; TRUNCATE working_session;
TRUNCATE meta_method;
TRUNCATE meta_instruction;
DROP TRIGGER IF EXISTS TRG_NEW_STUDENT_MAXENROLMENTS; DROP TRIGGER IF EXISTS TRG_NEW_STUDENT_MAXENROLMENTS;
DROP TRIGGER IF EXISTS TRG_NEW_STUDENT_UPDATE_ENROLMENTS; DROP TRIGGER IF EXISTS TRG_NEW_STUDENT_UPDATE_ENROLMENTS;
DROP TRIGGER IF EXISTS TRG_MODIFY_STUDENT_ENROLMENTS; DROP TRIGGER IF EXISTS TRG_MODIFY_STUDENT_ENROLMENTS;
......
...@@ -50,7 +50,7 @@ function LoginCtrl( ...@@ -50,7 +50,7 @@ function LoginCtrl(
$http $http
.get(config.backend + '/office/' + $stateParams.office) .get(config.backend + '/office/' + $stateParams.office)
.success(function (data) { .success(function (data) {
$scope.office = data; $scope.office = data;
}); });
} }
...@@ -59,6 +59,10 @@ function LoginCtrl( ...@@ -59,6 +59,10 @@ function LoginCtrl(
$http $http
.post(config.backend + '/sup/login', $scope.credentials) .post(config.backend + '/sup/login', $scope.credentials)
.success(function (data) { .success(function (data) {
// default logo to Pictogram logo
if (data.user.office.logo_url.length < 5)
data.user.office.logo_url = 'img/logo_pictogram.png';
$window.sessionStorage.token = data.token; $window.sessionStorage.token = data.token;
// Adapt language en-us to en-gb (the latter is the one supported for 'en') // Adapt language en-us to en-gb (the latter is the one supported for 'en')
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</p> </p>
--> -->
<p class="text-center"> <p class="text-center">
<img src="{{office.logo_url}}" alt="{{office.name}}" title="{{office.name}}"> <img ng-src="{{office.logo_url}}" alt="{{office.name}}" title="{{office.name}}">
</p> </p>
<!-- Formulario --> <!-- Formulario -->
<!-- LoginCtrl controls here, see app.js --> <!-- LoginCtrl controls here, see app.js -->
......
...@@ -16,25 +16,13 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -16,25 +16,13 @@ dashboardControllers.controller('AddPictoCtrl', function (
$translate, $translate,
ngToast, ngToast,
supervisor, supervisor,
student, student) {
categories,
studentPictos,
freeCategoryPictos,
emptyStudentPicto) {
$scope.source = 'symbolstx'; $scope.source = 'symbolstx';
$scope.categories = categories;
$scope.studentPictos = studentPictos;
$scope.pictos = []; $scope.pictos = [];
$scope.symbolstxCats = []; $scope.symbolstxCats = [];
$scope.breadcrumbs = []; $scope.breadcrumbs = [];
$scope.addedPictos = {};
$scope.freeAddedPictos = [];
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
$scope.categories.forEach(function (category) {
$scope.addedPictos[category.picto.id] = [];
});
$scope.breadcrumbs.push({ $scope.breadcrumbs.push({
id: 0, id: 0,
exp: 'Inicio', exp: 'Inicio',
...@@ -61,7 +49,7 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -61,7 +49,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
$http.get(config.backend + '/sup/' + supervisor.id + '/pic_fromcategory/' + categoryId) $http.get(config.backend + '/sup/' + supervisor.id + '/pic_fromcategory/' + categoryId)
.success(function (data) { .success(function (data) {
if (data) if (data)
$scope.pictos = data; $scope.pictos = data;
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
setTimeout(function () { $scope.$apply(); }); setTimeout(function () { $scope.$apply(); });
}) })
...@@ -190,188 +178,6 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -190,188 +178,6 @@ dashboardControllers.controller('AddPictoCtrl', function (
}; };
// //
// Add a picto to student when it is dropped into a category
//
$scope.handleDropAddPicto = function (addedPictoId, addedCategoryId) {
var pictoId = parseInt(document.getElementById(addedPictoId).dataset.pictoId, 10);
var pictoURI = document.getElementById(addedPictoId).dataset.pictoUri;
var categoryId = parseInt(document.getElementById(addedCategoryId).dataset.categoryId, 10);
var categoryGrid = $scope.studentPictos[categoryId];
var positionX;
var positionY;
// Check if there is space in category
for (positionX = 0; positionX < categoryGrid.length; positionX++) {
for (positionY = 0; positionY < categoryGrid[positionX].length; positionY++) {
if (categoryGrid[positionX][positionY] === emptyStudentPicto) {
break;
}
}
if (categoryGrid[positionX][positionY] === emptyStudentPicto) {
break;
}
}
if (typeof positionX !== 'number' || typeof positionY !== 'number') {
$translate('no_space_in_category').then(function (translation) {
ngToast.danger({ content: translation });
});
return;
}
// Send the picto to the server
$http.post(config.backend + '/stu/' + student.id + '/picto/' + pictoId, {
attributes: {
id_cat: categoryId,
coord_x: positionX,
coord_y: positionY
}
})
.success(function (studentPicto) {
$translate('picto_added').then(function (translation) {
ngToast.success({ content: translation });
});
studentPicto.picto.uri = pictoURI;
categoryGrid[positionX][positionY] = studentPicto;
$scope.addedPictos[categoryId].push(studentPicto);
io.socket.post('/stu/vocabulary', {
action: 'add',
attributes: {
id_stu: student.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function () {
$translate('error_adding_picto').then(function (translation) {
ngToast.danger({ content: translation });
});
});
};
/**
* A picto is added to the "free" category
*/
$scope.handleDropAddFreePicto = function (addedPictoId) {
var pictoId = parseInt(document.getElementById(addedPictoId).dataset.pictoId, 10);
var pictoURI = document.getElementById(addedPictoId).dataset.pictoUri;
var positionX;
var positionY;
// Check if there is space in category
for (positionX = 0; positionX < freeCategoryPictos.length; positionX++) {
for (positionY = 0; positionY < freeCategoryPictos[positionX].length; positionY++) {
if (freeCategoryPictos[positionX][positionY] === emptyStudentPicto) {
break;
}
}
if (freeCategoryPictos[positionX][positionY] === emptyStudentPicto) {
break;
}
}
if (typeof positionX !== 'number' || typeof positionY !== 'number') {
$translate('no_space_in_category').then(function (translation) {
ngToast.danger({ content: translation });
});
return;
}
// Send the picto to the server
$http.post(config.backend + '/stu/' + student.id + '/picto/' + pictoId, {
attributes: {
free_category_coord_x: positionX,
free_category_coord_y: positionY
}
})
.success(function (studentPicto) {
$translate('picto_added').then(function (translation) {
ngToast.success({ content: translation });
});
studentPicto.picto.uri = pictoURI;
freeCategoryPictos[positionX][positionY] = studentPicto;
$scope.freeAddedPictos.push(studentPicto);
io.socket.post('/stu/vocabulary', {
action: 'add',
attributes: {
id_stu: student.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function () {
$translate('error_adding_picto').then(function (translation) {
ngToast.danger({ content: translation });
});
});
};
//
// Delete picto added
//
$scope.remove_picto = function (studentPicto, categoryId) {
$http.delete(config.backend + '/stu/' + student.id + '/picto/' + studentPicto.id)
.success(function () {
var i;
$scope.studentPictos
[categoryId]
[studentPicto.attributes.coord_x]
[studentPicto.attributes.coord_y] = emptyStudentPicto;
for (i = 0; i < $scope.addedPictos[categoryId].length; i++) {
if (studentPicto === $scope.addedPictos[categoryId][i]) {
$scope.addedPictos[categoryId].splice(i, 1);
break;
}
}
// websocket emit vocabulary delete action
io.socket.post('/stu/vocabulary', {
action: 'delete',
attributes: {
id_stu: student.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function () {});
};
//
// Delete picto added to free category
//
$scope.removeFreePicto = function (studentPicto) {
$http.delete(config.backend + '/stu/' + student.id + '/picto/' + studentPicto.id)
.success(function () {
var i;
freeCategoryPictos
[studentPicto.attributes.free_category_coord_x]
[studentPicto.attributes.free_category_coord_y] = emptyStudentPicto;
for (i = 0; i < $scope.freeAddedPictos.length; i++) {
if (studentPicto === $scope.freeAddedPictos[i]) {
$scope.freeAddedPictos.splice(i, 1);
break;
}
}
// websocket emit vocabulary delete action
io.socket.post('/stu/vocabulary', {
action: 'delete',
attributes: {
id_stu: student.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function () {});
};
//
// Delete own picto // Delete own picto
// //
$scope.remove_own_picto = function (pictoId) { $scope.remove_own_picto = function (pictoId) {
...@@ -400,8 +206,8 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -400,8 +206,8 @@ dashboardControllers.controller('AddPictoCtrl', function (
}); });
}; };
$scope.close = function () { $scope.close = function (pictoId) {
$modalInstance.close('Ejemplo de elemento devuelto'); $modalInstance.close(pictoId);
}; };
$scope.cancel = function () { $scope.cancel = function () {
......
...@@ -68,55 +68,74 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -68,55 +68,74 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
studentPicto.attributes.id_cat; studentPicto.attributes.id_cat;
}; };
// Reload student pictos (back from addpicto) // function to make category colores brighter
$scope.loadPictos = function () { $scope.shadeColor = function (color, percent) {
function generateGrid() { var f=parseInt(color.slice(1),16),t=percent<0?0:255,p=percent<0?percent*-1:percent,R=f>>16,G=f>>8&0x00FF,B=f&0x0000FF;
var i; return "#"+(0x1000000+(Math.round((t-R)*p)+R)*0x10000+(Math.round((t-G)*p)+G)*0x100+(Math.round((t-B)*p)+B)).toString(16).slice(1);
var j; };
var gridWidth = 10;
var gridHeight = 5; /*
var grid = []; * Generates the grid of pictos with empty ones
for (i = 0; i < gridHeight; i++) { */
grid[i] = []; function generateGrid() {
for (j = 0; j < gridWidth; j++) { var i;
grid[i][j] = $scope.emptyStudentPicto; var j;
} var gridWidth = 10;
var gridHeight = 5;
var grid = [];
for (i = 0; i < gridHeight; i++) {
grid[i] = [];
for (j = 0; j < gridWidth; j++) {
grid[i][j] = $scope.emptyStudentPicto;
} }
return grid; }
return grid;
}
/*
* Places a picto in the grid
*/
function placePicto(picto) {
var positionX = picto.attributes.coord_x;
var positionY = picto.attributes.coord_y;
var freeCategoryPositionX = picto.attributes.free_category_coord_x;
var freeCategoryPositionY = picto.attributes.free_category_coord_y;
var category;
if ($scope.isCategory(picto)) {
$scope.categories.push(picto);
}
// Categories disabled
if (typeof freeCategoryPositionX === 'number' &&
typeof freeCategoryPositionY === 'number') {
$scope.freeCategoryPictos[freeCategoryPositionX][freeCategoryPositionY] = picto;
} }
// Categories enabled
if (positionX !== null && positionY !== null) {
category = $scope.isCategory(picto) ?
$scope.getCategoryId($scope.emptyStudentPicto) :
$scope.getCategoryId(picto);
$scope.studentPictos[category] = $scope.studentPictos[category] || generateGrid();
$scope.studentPictos[category][positionX][positionY] = picto;
}
};
// Reload student pictos (back from addpicto)
$scope.loadPictos = function () {
// Fill with grid (if not done before)
$scope.freeCategoryPictos = $scope.freeCategoryPictos || generateGrid(); $scope.freeCategoryPictos = $scope.freeCategoryPictos || generateGrid();
$scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] = $scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] =
$scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] || generateGrid(); $scope.studentPictos[$scope.getCategoryId($scope.selectedCategory)] || generateGrid();
// Get user's pictos
$http.get(config.backend + '/stu/' + $scope.studentData.id + '/pictos') $http.get(config.backend + '/stu/' + $scope.studentData.id + '/pictos')
.success(function (studentPictos) { .success(function (studentPictos) {
$scope.categories = []; $scope.categories = [];
$scope.showFreeCategory = !$scope.studentData.attributes.categories; $scope.showFreeCategory = !$scope.studentData.attributes.categories;
studentPictos.forEach(function (studentPicto) { studentPictos.forEach(placePicto);
var positionX = studentPicto.attributes.coord_x;
var positionY = studentPicto.attributes.coord_y;
var freeCategoryPositionX = studentPicto.attributes.free_category_coord_x;
var freeCategoryPositionY = studentPicto.attributes.free_category_coord_y;
var category;
if ($scope.isCategory(studentPicto)) {
$scope.categories.push(studentPicto);
}
if (typeof freeCategoryPositionX === 'number' &&
typeof freeCategoryPositionY === 'number') {
$scope.freeCategoryPictos[freeCategoryPositionX][freeCategoryPositionY] = studentPicto;
}
if (positionX !== null && positionY !== null) {
category = $scope.isCategory(studentPicto) ?
$scope.getCategoryId($scope.emptyStudentPicto) :
$scope.getCategoryId(studentPicto);
$scope.studentPictos[category] = $scope.studentPictos[category] || generateGrid();
$scope.studentPictos[category][positionX][positionY] = studentPicto;
}
});
$scope.loadingPictos = false; $scope.loadingPictos = false;
setTimeout(function () { $scope.$apply(); }); setTimeout(function () { $scope.$apply(); });
...@@ -285,7 +304,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -285,7 +304,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}; };
// Modal window to add pictos // Modal window to add pictos
$scope.open = function () { $scope.open_add = function (col, row) {
console.log(col + " " +row);
var modalInstance = $modal.open({ var modalInstance = $modal.open({
animation: true, animation: true,
templateUrl: 'modules/student/views/addpicto.html', templateUrl: 'modules/student/views/addpicto.html',
...@@ -297,23 +317,41 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -297,23 +317,41 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}, },
supervisor: function () { supervisor: function () {
return $scope.user; return $scope.user;
},
categories: function () {
return $scope.categories;
},
freeCategoryPictos: function () {
return $scope.freeCategoryPictos;
},
studentPictos: function () {
return $scope.studentPictos;
},
emptyStudentPicto: function () {
return $scope.emptyStudentPicto;
} }
} }
}); });
// Returned data from the modal window // Returned data from the modal window
modalInstance.result.then(function () { modalInstance.result.then(function (pictoId) {
// Send the picto to the server
$http.post(config.backend + '/stu/' + $scope.studentData.id + '/picto/' + pictoId, {
attributes: {
coord_x: $scope.showFreeCategory ? null : col,
coord_y: $scope.showFreeCategory ? null : row,
status: 'enabled',
free_category_coord_x: $scope.showFreeCategory ? col : null,
free_category_coord_y: $scope.showFreeCategory ? row : null
}
})
.success(function (studentPicto) {
console.log(studentPicto.attributes);
placePicto(studentPicto);
io.socket.post('/stu/vocabulary', {
action: 'add',
attributes: {
id_stu: $scope.studentData.id,
stu_picto: studentPicto
}
}, function () {});
})
.error(function () {
$translate('error_adding_picto').then(function (translation) {
ngToast.danger({ content: translation });
});
});
$scope.loadPictos(); $scope.loadPictos();
}); });
}; };
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<alert ng-show="alert.show" ng-model="alert" type="{{alert.type}}" close="closeAlert()">{{alert.msg}}</alert> <alert ng-show="alert.show" ng-model="alert" type="{{alert.type}}" close="closeAlert()">{{alert.msg}}</alert>
</div> </div>
<div class="row"> <div class="row">
<div id="collections" class="col-md-9 category-collection" <div id="collections" class="col-md-12 category-collection"
ng-class="{ 'category-collection-loading': loadingCatPictos }" ng-class="{ 'category-collection-loading': loadingCatPictos }"
data-loading="{{ 'loading_pictos' | translate }}"> data-loading="{{ 'loading_pictos' | translate }}">
<div class="input-group" id="search_pictos_box"> <div class="input-group" id="search_pictos_box">
...@@ -44,11 +44,7 @@ ...@@ -44,11 +44,7 @@
<!-- Galería de pictos --> <!-- Galería de pictos -->
<div <div
class="picto_peq pull-left" class="picto_peq pull-left"
ng-repeat="p in pictos | filter:srch_term_picto" ng-repeat="p in pictos | filter:srch_term_picto">
draggable
id="added-picto-{{p.id}}"
data-picto-id="{{p.id}}"
data-picto-uri="{{p.uri}}">
<img ng-src="{{p.uri}}" popover="{{p.expressions[0].text}}" popover-trigger="mouseenter" /> <img ng-src="{{p.uri}}" popover="{{p.expressions[0].text}}" popover-trigger="mouseenter" />
<!-- Options to remove picto (Only for own pictos) --> <!-- Options to remove picto (Only for own pictos) -->
<div class="picto_options" ng-show="source == 'ownpictos'"> <div class="picto_options" ng-show="source == 'ownpictos'">
...@@ -56,56 +52,22 @@ ...@@ -56,56 +52,22 @@
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span> <span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a> </a>
</div> </div>
</div> <div class="picto_options">
<div class="clearfix"></div> <a ng-click="remove_own_picto(p.id)" class="picto_remove" title="{{ 'delete' | translate}}">
</div> <a
<div class="col-md-3"> ng-click="close(p.id)"
<div id="pictos_to_add"> class="picto_add"
<h4 class="text-center">Para añadir</h4> title="{{ 'add_picto' | translate}}">
<div class="panel panel-default" droppableadd drop="handleDropAddFreePicto"> <i class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></i>
<div class="panel-heading"><span translate>free_category</span></div> </a>
<div class="panel-body"> </a>
<div
class="picto_peq pull-left"
ng-repeat="pa in freeAddedPictos"
id="{{pa.picto.id}}">
<img ng-src="{{pa.picto.uri}}" class="unselectable" popover="{{pa.expressions[0].text}}" popover-trigger="mouseenter" />
<div class="picto_options">
<a ng-click="removeFreePicto(pa, c.picto.id)" class="picto_remove" title="{{ 'delete' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</div>
</div>
</div>
</div>
<div class="picto_cat" ng-repeat="c in categories">
<div
class="panel panel-default"
id="added-category-{{c.picto.id}}"
data-category-id="{{ c.picto.id }}"
droppableadd drop="handleDropAddPicto">
<div class="panel-heading">
<img ng-src="{{c.picto.uri}}" class="unselectable" />
<span>{{c.expression.text}}</span>
</div>
<div class="panel-body" >
<div class="picto_peq pull-left" ng-repeat="pa in addedPictos[c.picto.id]" id="{{pa.picto.id}}">
<img ng-src="{{pa.picto.uri}}" class="unselectable" popover="{{pa.expressions[0].text}}" popover-trigger="mouseenter" />
<div class="picto_options">
<a ng-click="remove_picto(pa, c.picto.id)" class="picto_remove" title="{{ 'delete' | translate}}">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
</div>
</div>
</div>
</div>
</div> </div>
<div class="clearfix"></div>
</div> </div>
<div class="clearfix"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" ng-click="close()">{{ 'close' | translate }}</button> <button class="btn btn-primary" ng-click="cancel()">{{ 'close' | translate }}</button>
</div> </div>
</div> </div>
<!-- Collection tab--> <!-- Collection tab-->
<div class="panel panel-default student_tab_panel"> <div class="panel panel-default student_tab_panel">
<div class="panel-body"> <div class="panel-body">
<!--
<div class="row"> <div class="row">
<!-- Fin de columna vistas por categorías -->
<div class="col-md-6"> <div class="col-md-6">
<a class="btn btn-success btn-sm" role="button" ng-click="open()"> <a class="btn btn-success btn-sm" role="button" ng-click="open()">
<i class="glyphicon glyphicon-plus" aria-hidden="true"></i> <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
...@@ -10,28 +10,32 @@ ...@@ -10,28 +10,32 @@
</a> </a>
</div> </div>
</div> </div>
-->
<div <div
id="student_collection" id="student_collection"
class="student-collection" class="student-collection"
ng-class="{ 'student-collection-loading': loadingPictos }" ng-class="{ 'student-collection-loading': loadingPictos }"
data-loading="{{ 'loading_pictos' | translate }}"> data-loading="{{ 'loading_pictos' | translate }}">
<!-- No categories grid -->
<div <div
ng-if="showFreeCategory" ng-if="showFreeCategory"
class="picto-grid picto-free-grid"> class="picto-grid picto-free-grid">
<div <div
ng-repeat="studentPictoRow in freeCategoryPictos" ng-repeat="studentPictoRow in freeCategoryPictos"
ng-init="rowIndex = $index"
class="picto-grid__row"> class="picto-grid__row">
<div <div
class="picto pull-left" class="picto pull-left"
data-row="{{ $parent.$index }}" data-row="{{ rowIndex }}"
data-column="{{ $index }}" data-column="{{ colIndex }}"
id="student-picto-{{ id="student-picto-{{
studentPicto.id || studentPicto.id ||
('empty-' + $index + '-' + $parent.$index) ('empty-' + colIndex + '-' + rowIndex)
}}" }}"
draggable droppable drop="handleDrop" draggable droppable drop="handleDrop"
popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
...@@ -45,9 +49,19 @@ ...@@ -45,9 +49,19 @@
'deactivate': studentPicto.attributes.status == 'disabled' 'deactivate': studentPicto.attributes.status == 'disabled'
}" }"
ng-style="{ ng-style="{
'background-color': studentPicto.attributes.color 'background-color': studentPicto.attributes.color || '#ffffff'
}"/> }"/>
<div <div
class="picto_options"
ng-if="studentPicto == emptyStudentPicto">
<a
ng-click="open_add(rowIndex, colIndex)"
class="picto_add"
title="{{ 'add_picto' | translate}}">
<i class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></i>
</a>
</div>
<div
class="picto_options" class="picto_options"
ng-if="studentPicto !== emptyStudentPicto"> ng-if="studentPicto !== emptyStudentPicto">
<a <a
...@@ -81,6 +95,8 @@ ...@@ -81,6 +95,8 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<!-- / No categories grid -->
<!-- Main categories grid -->
<div <div
ng-if="!showFreeCategory" ng-if="!showFreeCategory"
class="picto-grid picto-main-grid"> class="picto-grid picto-main-grid">
...@@ -125,27 +141,31 @@ ...@@ -125,27 +141,31 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<!-- / Main categories grid -->
<!-- Category grid -->
<a name="picto-category-grid"/> <a name="picto-category-grid"/>
<div <div
id="picto-category-grid" id="picto-category-grid"
class="picto-grid picto-category-grid" class="picto-grid picto-category-grid"
ng-if="selectedCategory !== emptyStudentPicto && !showFreeCategory" ng-if="selectedCategory !== emptyStudentPicto && !showFreeCategory"
ng-style="{ 'background-color': selectedCategory.attributes.color }"> ng-style="{ 'background-color': shadeColor(selectedCategory.attributes.color, 0.3) }">
<h3 class="picto-category-grid__title">{{ selectedCategory.expression.text }}</h3> <h3 class="picto-category-grid__title">{{ selectedCategory.expression.text }}</h3>
<div <div
ng-repeat="studentPictoRow in studentPictos[getCategoryId(selectedCategory)]" ng-repeat="studentPictoRow in studentPictos[getCategoryId(selectedCategory)]"
ng-init="rowIndex = $index"
class="picto-grid__row"> class="picto-grid__row">
<div <div
class="picto pull-left" class="picto pull-left"
data-row="{{ $parent.$index }}" data-row="{{ rowIndex }}"
data-column="{{ $index }}" data-column="{{ colIndex }}"
id="student-picto-{{ id="student-picto-{{
studentPicto.id || studentPicto.id ||
('empty-' + $index + '-' + $parent.$index) ('empty-' + colIndex + '-' + rowIndex)
}}" }}"
draggable droppable drop="handleDrop" draggable droppable drop="handleDrop"
popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}" popover="{{studentPicto.attributes.expression==null ? studentPicto.expression.text : studentPicto.attributes.expression}}"
popover-trigger="mouseenter" popover-trigger="mouseenter"
ng-init="colIndex = $index"
ng-repeat="studentPicto in studentPictoRow track by $index"> ng-repeat="studentPicto in studentPictoRow track by $index">
<img <img
src="/app/img/redcross.png" src="/app/img/redcross.png"
...@@ -159,8 +179,19 @@ ...@@ -159,8 +179,19 @@
'deactivate': studentPicto.attributes.status == 'disabled' 'deactivate': studentPicto.attributes.status == 'disabled'
}" }"
ng-style="{ ng-style="{
'background-color': studentPicto.attributes.color 'background-color': studentPicto.attributes.color || '#ffffff'
}"/> }"
/>
<div
class="picto_options"
ng-if="studentPicto == emptyStudentPicto">
<a
ng-click="open_add(rowIndex, colIndex)"
class="picto_add"
title="{{ 'add_picto' | translate}}">
<i class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></i>
</a>
</div>
<div <div
class="picto_options" class="picto_options"
ng-if="studentPicto !== emptyStudentPicto"> ng-if="studentPicto !== emptyStudentPicto">
...@@ -195,6 +226,7 @@ ...@@ -195,6 +226,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<!-- / Category grid -->
</div> </div>
</div> </div>
</div> </div>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
href="/app/#/students"> href="/app/#/students">
<img <img
class="topbar__logo__image" class="topbar__logo__image"
src="{{user.office.logo_url}}" ng-src="{{user.office.logo_url}}"
alt="{{user.office.name}}" alt="{{user.office.name}}"
title="{{user.office.name}}" /> title="{{user.office.name}}" />
</a> </a>
......
...@@ -433,11 +433,15 @@ textarea.editable{ ...@@ -433,11 +433,15 @@ textarea.editable{
display: block; display: block;
} }
/* Picto options in own picto (supervisor) collection */ /* Picto options in own picto (supervisor) collection */
#collections .picto_peq .picto_options .picto_remove{ position: absolute; top: 18px; left: 20px; } /* #collections .picto_peq .picto_options .picto_remove{ position: absolute; top: 18px; left: 20px; } */
#collections .picto_peq .picto_options .picto_remove{ position: absolute; top: 2px; left: 2px; }
#collections .picto_peq .picto_options .picto_add{ position: absolute; top: 2px; right: 2px; }
/* Picto options when adding a picto to a category */ /* Picto options when adding a picto to a category */
.picto_cat .picto_peq .picto_options .picto_remove{ position: absolute; top: 4px; left: 7px; } .picto_cat .picto_peq .picto_options .picto_remove{ position: absolute; top: 4px; left: 7px; }
/* Picto options in student collection */ /* Picto options in student collection */
.picto .picto_options .picto_remove{ position: absolute; top: 2px; left: 2px; } .picto .picto_options .picto_remove{ position: absolute; top: 2px; left: 2px; }
.picto .picto_options .picto_add{ position: absolute; top: 28px; left: 28px; }
.picto .picto_options .picto_ok{ position: absolute; top: 2px; right: 2px; } .picto .picto_options .picto_ok{ position: absolute; top: 2px; right: 2px; }
.picto .picto_options .picto_tags{ position: absolute; bottom: 2px; left: 2px; } .picto .picto_options .picto_tags{ position: absolute; bottom: 2px; left: 2px; }
.picto .picto_options .picto_config{ position: absolute; bottom: 2px; right: 2px; } .picto .picto_options .picto_config{ position: absolute; bottom: 2px; right: 2px; }
......
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