Commit 93c969ca by Fernando Martínez Santiago

Merge branch 'develop' of http://gitlab.ujaen.es/yotta/pictogram into develop

parents f0c9c484 7db3758a
...@@ -220,10 +220,10 @@ module.exports = { ...@@ -220,10 +220,10 @@ module.exports = {
var sql = ""; var sql = "";
var params = []; var params = [];
if(typeof categories == "object" ){ //Is an array if(typeof categories == "object" ){ //Is an array
sql="SELECT `picto_exp`.`id`, `picto_exp`.`id_pic`, `picto_exp`.`lang`, `picto_exp`.`text`, `picto`.`id`, `picto`.`uri`, `picto`.`id_src`, `picto`.`id_owner`, `picto`.`id_cat` FROM `picto_exp` INNER JOIN `picto` ON `picto_exp`.`id_pic` = `picto`.`id` WHERE `picto_exp`.`lang`=? AND `picto_exp`.`text` LIKE ? AND (`picto`.`id_owner` IS NULL OR `picto`.`id_owner`=?) AND `picto`.`id_src`=? AND `picto`.`id_cat` IN (?);"; sql="SELECT `picto_exp`.`id`, `picto_exp`.`id_pic`, `picto_exp`.`lang`, `picto_exp`.`text`, `picto`.`id`, `picto`.`uri`, `picto`.`id_src`, `picto`.`id_owner`, `picto`.`id_cat` FROM `picto_exp` INNER JOIN `picto` ON `picto_exp`.`id_pic` = `picto`.`id` WHERE `picto_exp`.`lang`=? AND `picto_exp`.`text` LIKE ? AND (`picto`.`id_owner` IS NULL OR `picto`.`id_owner`=?) AND `picto`.`id_src`=? AND `picto`.`id_cat` IN (?) ORDER BY LENGTH(`picto_exp`.`text`) LIMIT 200;";
params = [req.params.lang,'%'+req.params.text+'%', req.params.sup_id, req.params.source, categories]; params = [req.params.lang,'%'+req.params.text+'%', req.params.sup_id, req.params.source, categories];
}else{ }else{
sql= "SELECT `picto_exp`.`id`, `picto_exp`.`id_pic`, `picto_exp`.`lang`, `picto_exp`.`text`, `picto`.`id`, `picto`.`uri`, `picto`.`id_src`, `picto`.`id_owner`, `picto`.`id_cat` FROM `picto_exp` INNER JOIN `picto` ON `picto_exp`.`id_pic` = `picto`.`id` WHERE `picto_exp`.`lang`=? AND `picto_exp`.`text` LIKE ? AND (`picto`.`id_owner` IS NULL OR `picto`.`id_owner`=?) AND `picto`.`id_src`=?;"; sql= "SELECT `picto_exp`.`id`, `picto_exp`.`id_pic`, `picto_exp`.`lang`, `picto_exp`.`text`, `picto`.`id`, `picto`.`uri`, `picto`.`id_src`, `picto`.`id_owner`, `picto`.`id_cat` FROM `picto_exp` INNER JOIN `picto` ON `picto_exp`.`id_pic` = `picto`.`id` WHERE `picto_exp`.`lang`=? AND `picto_exp`.`text` LIKE ? AND (`picto`.`id_owner` IS NULL OR `picto`.`id_owner`=?) AND `picto`.`id_src`=? ORDER BY LENGTH(`picto_exp`.`text`) LIMIT 200;";
params = [req.params.lang,'%'+req.params.text+'%', req.params.sup_id, req.params.source]; params = [req.params.lang,'%'+req.params.text+'%', req.params.sup_id, req.params.source];
} }
......
...@@ -273,6 +273,7 @@ ...@@ -273,6 +273,7 @@
"new_instruction": "New instruction", "new_instruction": "New instruction",
"new_method": "New method", "new_method": "New method",
"new_objective": "New objective", "new_objective": "New objective",
"new_grid": "New grid",
"new_grid_with_categories": "Create grid with categories", "new_grid_with_categories": "Create grid with categories",
"new_grid_without_categories": "Create grid without categories", "new_grid_without_categories": "Create grid without categories",
"new_session": "New session", "new_session": "New session",
......
...@@ -272,6 +272,7 @@ ...@@ -272,6 +272,7 @@
"new_instruction": "Nueva instrucción", "new_instruction": "Nueva instrucción",
"new_method": "Nuevo método", "new_method": "Nuevo método",
"new_objective": "Nuevo objetivo", "new_objective": "Nuevo objetivo",
"new_grid": "Nuevo tablero",
"new_grid_with_categories": "Crear escena con categorías", "new_grid_with_categories": "Crear escena con categorías",
"new_grid_without_categories": "Crear escena sin categorías", "new_grid_without_categories": "Crear escena sin categorías",
"new_session": "Nueva sesión", "new_session": "Nueva sesión",
......
...@@ -250,3 +250,42 @@ dashboardDirectives.directive('popoveraddpicto', function() { ...@@ -250,3 +250,42 @@ dashboardDirectives.directive('popoveraddpicto', function() {
} }
} }
}); });
// for assigning a class within ng-options
dashboardDirectives.directive('optionsClass', function ($parse) {
return {
require: 'select',
link: function(scope, elem, attrs, ngSelect) {
// get the source for the items array that populates the select.
var pattern = /.* in ([\w]+) .*/g;
var optionsSourceStr = pattern.exec(attrs.ngOptions)[1],
// use $parse to get a function from the options-class attribute
// that you can use to evaluate later.
getOptionsClass = $parse(attrs.optionsClass);
scope.$watch(optionsSourceStr, function(items) {
// when the options source changes loop through its items.
angular.forEach(items, function(item, index) {
// evaluate against the item to get a mapping object for
// for your classes.
var classes = getOptionsClass(item),
// also get the option you're going to need. This can be found
// by looking for the option with the appropriate index in the
// value attribute.
option = elem.find('option[value=' + item.id + ']');
// now loop through the key/value pairs in the mapping object
// and apply the classes that evaluated to be truthy.
angular.forEach(classes, function(add, className) {
if (add) {
angular.element(option).addClass(className);
} else {
angular.element(option).removeClass(className);
}
});
});
});
}
};
});
...@@ -398,6 +398,8 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -398,6 +398,8 @@ dashboardControllers.controller('AddPictoCtrl', function (
$scope.page=1; // Reset pagination $scope.page=1; // Reset pagination
$scope.pictos = []; // Reset pictos
var length = $scope.srch_term_picto == undefined ? 0 : $scope.srch_term_picto.length; var length = $scope.srch_term_picto == undefined ? 0 : $scope.srch_term_picto.length;
if(length == 1){ //Check the word length if(length == 1){ //Check the word length
$scope.alert = { type: 'warning', msg: 'warning_two_characters', show: true }; $scope.alert = { type: 'warning', msg: 'warning_two_characters', show: true };
...@@ -452,10 +454,15 @@ dashboardControllers.controller('AddPictoCtrl', function ( ...@@ -452,10 +454,15 @@ dashboardControllers.controller('AddPictoCtrl', function (
$http.get(request) $http.get(request)
.success(function (data) { .success(function (data) {
// Load data into pictos
$scope.pictos = data; $scope.pictos = data;
// No data warning
if(data.length == 0){ if(data.length == 0){
$scope.alert = { type: 'warning', msg: 'warning_no_pictos_found', show: true }; $scope.alert = { type: 'warning', msg: 'warning_no_pictos_found', show: true };
} }
$scope.loadingCatPictos = false; $scope.loadingCatPictos = false;
}) })
.error(function () { .error(function () {
......
...@@ -18,7 +18,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -18,7 +18,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$anchorScroll, $anchorScroll,
$modal, $modal,
$translate, $translate,
ngToast) { ngToast,
$timeout) {
$scope.emptyStudentPicto = { $scope.emptyStudentPicto = {
id: null, id: null,
...@@ -42,74 +43,20 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -42,74 +43,20 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope.mainGrid = null; $scope.mainGrid = null;
$scope.loadingPictos = true; $scope.loadingPictos = true;
$scope.viewingGrid = {}; $scope.viewingGrid = {};
$scope.gridsList = null; $scope.gridsList = [];
$scope.newGridName = ""; $scope.newGridName = "";
$scope.breadcrumbs = []; $scope.breadcrumbs = [];
// function to make category colores brighter /***************************************************************************
$scope.shadeColor = function (color, percent) { * GRIDS MANAGEMENT
if (!color) ********************************/
return;
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;
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);
};
/*
* Generates the grid of pictos with empty ones
*/
function generateGrid() {
var i;
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;
}
/*
* Places a picto in the grid
*/
function placePicto(picto) {
var positionX = picto.attributes.coord_x;
var positionY = picto.attributes.coord_y;
// Fill with grid (if not done before)
$scope.mainGrid = $scope.mainGrid || generateGrid();
if (positionX !== null && positionY !== null) {
$scope.mainGrid[positionX][positionY] = picto;
}
};
/** /**
* get and show active grid * get and show active grid
*/ */
$scope.showActiveGrid = function (grid) { $scope.showActiveGrid = function () {
$scope.loadingPictos = true; var active = $scope.gridsList.find((x) => x.active);
$scope.mainGrid = $scope.mainGrid || generateGrid(); $scope.showGrid(active.id, 'menu');
$http.get(config.backend + '/stu/' + $scope.studentData.id + '/activeGrid')
.success(function (activeGrid) {
activeGrid.name = $translate.instant(activeGrid.name);
activeGrid.pictos.forEach(placePicto);
$scope.viewingGrid = activeGrid;
$scope.loadingPictos = false;
$scope.breadcrumbs = [{id:activeGrid.id,name:activeGrid.name}];
})
.error(function () {
$translate('error_loading_grid').then(function (translation) {
ngToast.danger({ content: translation });
});
});
}; };
/** /**
...@@ -130,8 +77,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -130,8 +77,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
.success(function (grid) { .success(function (grid) {
grid.name = $translate.instant(grid.name); grid.name = $translate.instant(grid.name);
grid.pictos.forEach(placePicto); grid.pictos.forEach(placePicto);
$scope.viewingGrid = grid; $scope.viewingGrid = grid;
$scope.loadingPictos = false; $scope.loadingPictos = false;
// Breadcrumbs update // Breadcrumbs update
...@@ -150,29 +97,34 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -150,29 +97,34 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
// Add new element // Add new element
$scope.breadcrumbs.push({id:grid.id,name:grid.name}); $scope.breadcrumbs.push({id:grid.id,name:grid.name});
} }
}) })
.error(function () { .error(function () {
$translate('error_loading_grid').then(function (translation) { ngToast.danger($translate.instant('error_loading_grid'));
ngToast.danger({ content: translation });
});
}); });
}; };
/** /**
* Load the grid list * Load the grid list
*/ */
$scope.loadGridsList = function () { $scope.loadGridsListNoScope = function (callback) {
$http.get(config.backend + '/stu/' + $scope.studentData.id +'/grids') $http.get(config.backend + '/stu/' + $scope.studentData.id +'/grids')
.success(function (grids) { .success(function (grids) {
grids.map((sce) => {sce.name = $translate.instant(sce.name); return sce}); grids.map((g) => {
$scope.gridsList = grids; g.name = $translate.instant(g.name);
//setTimeout(function () { $scope.$apply(); }); return g;
});
if (callback) callback(grids);
}) })
.error(function () { .error(function () {
$translate('error_loading_grids').then(function (translation) { ngToast.danger($translate.instant('error_loading_grids'));
ngToast.danger({ content: translation }); if (callback) callback(null);
}); });
};
$scope.loadGridsList = function (callback) {
$scope.loadGridsListNoScope((grids) => {
$scope.gridsList = grids;
if (callback) callback(grids);
}); });
}; };
...@@ -196,15 +148,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -196,15 +148,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
action: 'delete', action: 'delete',
grid: {id:grid.id} grid: {id:grid.id}
}, function () {}); }, function () {});
$scope.loadGridsList(() => {
//Reload active grid
if(grid == $scope.viewingGrid){
$scope.showActiveGrid(); $scope.showActiveGrid();
} });
//Reload grids list
$scope.loadGridsList();
ngToast.success($translate.instant('grid_deleted')); ngToast.success($translate.instant('grid_deleted'));
}).error(function () { }).error(function () {
...@@ -277,10 +223,138 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -277,10 +223,138 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}, function () {}); }, function () {});
ngToast.success($translate.instant('grid_duplicated')); ngToast.success($translate.instant('grid_duplicated'));
$scope.loadGridsList(); $scope.loadGridsList(() => {
$scope.showGrid(newGrid.id, 'menu');
});
}).error(function () {});
};
/**
* Modal window to open grid color config
*/
$scope.open_grid_color = function (grid) {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/student/views/gridconfig.html',
controller: 'GridConfigCtrl',
size: 'md',
resolve: { // Passing data to the controller of the window
gridColor: function () {
return $scope.viewingGrid.color;
},
}
});
modalInstance.result.then(function (color) {
$scope.viewingGrid.color = color;
$http.put(config.backend + '/grid/' + $scope.viewingGrid.id + '/stu/' + $scope.studentData.id, {
color: $scope.viewingGrid.color
})
.success(function (stu) {
io.socket.post('/stu/config', {
action: 'update',
attributes: stu
}, function () {});
ngToast.success($translate.instant('grid_updated'));
}).error(function () {}); }).error(function () {});
});
};
/**
* Modal window to create grids
*/
$scope.open_new_grid = function () {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/student/views/newgrid.html',
controller: 'NewGridCtrl',
size: 'md',
resolve: { }
});
// Returned data from the modal window
modalInstance.result.then(function (name) {
if(!name)
return;
$http.post(config.backend + '/grid/stu/' + $scope.studentData.id, {
name: name,
id_sup: $rootScope.user.id,
id_stu: $scope.studentData.id
})
.success(function (grid) {
var data = {
name: grid.name,
active: false,
student: grid.student,
supervisor: grid.supervisor
};
io.socket.post('/grid', {
action: 'add',
grid: data
}, function () {});
ngToast.success($translate.instant('grid_added'));
$scope.loadGridsList(() => {$scope.showGrid(grid.id, 'menu')});
}).error(function () {});
});
};
/***************************************************************************
* PICTOS MANAGEMENT
********************************/
// function to make category colores brighter
$scope.shadeColor = function (color, percent) {
if (!color)
return;
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;
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);
};
/*
* Generates the grid of pictos with empty ones
*/
function generateGrid() {
var i;
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;
}
/*
* Places a picto in the grid
*/
function placePicto(picto) {
var positionX = picto.attributes.coord_x;
var positionY = picto.attributes.coord_y;
// Fill with grid (if not done before)
$scope.mainGrid = $scope.mainGrid || generateGrid();
if (positionX !== null && positionY !== null) {
$scope.mainGrid[positionX][positionY] = picto;
}
}; };
/** /**
...@@ -449,9 +523,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -449,9 +523,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}) })
.error(function (err) { .error(function (err) {
if (err.code && err.code == 1) // codes are in sails/config/pictogram.js if (err.code && err.code == 1) // codes are in sails/config/pictogram.js
ngToast.danger({ content: $translate.instant('error_duplicated_picto') }); ngToast.danger($translate.instant('error_duplicated_picto'));
else else
ngToast.danger({ content: $translate.instant('error_adding_picto') }); ngToast.danger($translate.instant('error_adding_picto'));
}); });
}); });
}; };
...@@ -520,97 +594,27 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -520,97 +594,27 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
}); });
}; };
/** /***************************************************************************
* Modal window to open grid color config * WEBSOCKETS
*/ *********************************/
$scope.open_grid_color = function (grid) {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/student/views/gridconfig.html',
controller: 'GridConfigCtrl',
size: 'md',
resolve: { // Passing data to the controller of the window
gridColor: function () {
return $scope.viewingGrid.color;
},
}
});
modalInstance.result.then(function (color) {
$scope.viewingGrid.color = color;
$http.put(config.backend + '/grid/' + $scope.viewingGrid.id + '/stu/' + $scope.studentData.id, {
color: $scope.viewingGrid.color
})
.success(function (stu) {
io.socket.post('/stu/config', {
action: 'update',
attributes: stu
}, function () {});
ngToast.success($translate.instant('grid_updated'));
}).error(function () {});
});
};
/**
* Modal window to create grids
*/
$scope.open_new_grid = function () {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'modules/student/views/newgrid.html',
controller: 'NewGridCtrl',
size: 'md',
resolve: { }
});
// Returned data from the modal window
modalInstance.result.then(function (name) {
if(!name)
return;
$http.post(config.backend + '/grid/stu/' + $scope.studentData.id, {
name: name,
id_sup: $rootScope.user.id,
id_stu: $scope.studentData.id
})
.success(function (grid) {
var data = {
name: grid.name,
active: false,
student: grid.student,
supervisor: grid.supervisor
};
io.socket.post('/grid', {
action: 'add',
grid: data
}, function () {});
ngToast.success($translate.instant('grid_added'));
$scope.loadGridsList();
$scope.showGrid(grid.id, 'menu');
}).error(function () {});
});
};
// Add new listener to the event // Add new listener to the event
io.socket.off('vocabulary'); io.socket.off('vocabulary');
io.socket.on('vocabulary', function (data) { io.socket.on('vocabulary', function (data) {
if(data.attributes.id_grid == $scope.viewingGrid.id){ if(data.attributes.id_grid == $scope.viewingGrid.id){
//Reload grid
$translate('reload_grid').then(function (translation) { // Reload data
ngToast.success({ content: translation }); if(data.attributes.all_pictos == true){
}); // Reload all
$scope.showGrid(data.attributes.id_grid); $scope.showGrid(data.attributes.id_grid, 'menu');
}else{
// Reload only modified picto
if(data.action == "delete")
$scope.mainGrid[data.attributes.stu_picto.attributes.coord_x][data.attributes.stu_picto.attributes.coord_y] = $scope.emptyStudentPicto;
else
$scope.mainGrid[data.attributes.stu_picto.attributes.coord_x][data.attributes.stu_picto.attributes.coord_y] = data.attributes.stu_picto;
}
} }
$scope.$apply(); $scope.$apply();
}); });
...@@ -620,16 +624,12 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -620,16 +624,12 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
io.socket.on('grid', function (data) { io.socket.on('grid', function (data) {
if(data.action == "delete" && data.grid.id == $scope.viewingGrid.id){ if(data.action == "delete" && data.grid.id == $scope.viewingGrid.id){
//Grid deleted //Grid deleted
$translate('grid_deleted').then(function (translation) { ngToast.success($translate.instant('grid_deleted'));
ngToast.success({ content: translation });
});
$scope.showActiveGrid(); $scope.showActiveGrid();
}else if(data.action == "update" && data.grid.id == $scope.viewingGrid.id){ } else if(data.action == "update" && data.grid.id == $scope.viewingGrid.id){
$translate('grid_updated').then(function (translation) { ngToast.success($translate.instant('grid_updated'));
ngToast.success({ content: translation }); $scope.showGrid(data.grid.id, 'menu');
});
$scope.showGrid(data.grid.id);
} }
$scope.loadGridsList(); $scope.loadGridsList();
$scope.$apply(); $scope.$apply();
...@@ -643,7 +643,14 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec ...@@ -643,7 +643,14 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
} }
); );
// Load pictos /***************************************************************************
$scope.showActiveGrid(); * INITIALIZATION
$scope.loadGridsList(); *********************************/
$scope.loadGridsListNoScope((grids) => {
$scope.viewingGrid = grids.find((x) => x.active);
$scope.gridsList = grids;
$scope.showActiveGrid();
});
}); });
...@@ -89,12 +89,17 @@ dashboardControllers.controller('PictoConfigCtrl', function ( ...@@ -89,12 +89,17 @@ dashboardControllers.controller('PictoConfigCtrl', function (
.then(function(result) { .then(function(result) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
// If update_all_legend then set attribute true
var all_pictos = false;
if($scope.update_all_legend) all_pictos = true;
io.socket.post('/stu/vocabulary', { io.socket.post('/stu/vocabulary', {
action: 'update', action: 'update',
attributes: { attributes: {
id_stu: stu.id, id_stu: stu.id,
id_grid: viewingGrid.id, id_grid: viewingGrid.id,
stu_picto: result stu_picto: result,
all_pictos: all_pictos
} }
}, },
function(res) {}); function(res) {});
......
...@@ -18,6 +18,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl( ...@@ -18,6 +18,9 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
lodash, lodash,
ngToast) { ngToast) {
// For date validation
$scope.maxDate = new Date();
// For tab navigation (here too, if the user refresh the page...) // For tab navigation (here too, if the user refresh the page...)
$scope.nav.tab = 'setup'; $scope.nav.tab = 'setup';
......
...@@ -122,11 +122,7 @@ ...@@ -122,11 +122,7 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<button type="button" class="btn btn-default" ng-click="open_grid_color(viewingGrid)" style="min-width:9.25em;">{{ 'setup' | translate }}</button> <button type="button" class="btn btn-primary" ng-click="open_grid_color(viewingGrid)" aria-expanded="false" title="{{ 'setup' | translate }}"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></button>
</div>
<div class="form-group row">
<button type="button" class="btn btn-success" ng-click="open_new_grid()" aria-expanded="false"><i class="fa fa-plus" aria-hidden="true"></i></button>
<button type="button" class="btn btn-primary" ng-click="copy_grid()" title="{{ 'duplicate' | translate }}"><i class="fa fa-files-o" aria-hidden="true"></i></button> <button type="button" class="btn btn-primary" ng-click="copy_grid()" title="{{ 'duplicate' | translate }}"><i class="fa fa-files-o" aria-hidden="true"></i></button>
<button type="button" class="btn btn-danger" ng-click="delete_grid(viewingGrid)" title="{{ 'delete' | translate }}"><i class="fa fa-trash" aria-hidden="true"></i></button> <button type="button" class="btn btn-danger" ng-click="delete_grid(viewingGrid)" title="{{ 'delete' | translate }}"><i class="fa fa-trash" aria-hidden="true"></i></button>
</div> </div>
...@@ -135,19 +131,12 @@ ...@@ -135,19 +131,12 @@
<label class="grid-panel-head">{{ 'show_grids' | translate }}</label> <label class="grid-panel-head">{{ 'show_grids' | translate }}</label>
<div class="form-group row"> <div class="form-group row">
<select class="grid-panel-select" ng-model="viewingGrid.id" ng-change="showGrid(viewingGrid.id,'menu')" size="7"> <select ng-options="grid as grid.name for grid in gridsList | orderBy: 'name' track by grid.id" ng-model="viewingGrid" ng-change="showGrid(viewingGrid.id,'menu')" size="7" options-class="{'grid-panel-select-optionactive': active, 'grid-panel-select-optioninactive': !active}"></select>
<option value="{{grid.id}}" ng-repeat="grid in gridsList | orderBy: 'name' track by $index" ng-selected="grid.id == viewingGrid.id" ng-class="{'grid-panel-select-optionactive': grid.active}">
{{ grid.name }}
</option>
</select>
</div> </div>
<div class="form-group row">
<!--<div class="list-group"> <button type="button" class="btn btn-success" ng-click="open_new_grid()" style="min-width:9.25em;"><i class="fa fa-plus" aria-hidden="true"></i> {{ 'new_grid' | translate }}</button>
<a class="list-group-item" ng-repeat="grid in gridsList track by $index" ng-click="showGrid(grid.id,false)" ng-class="(grid.id == viewingGrid.id) ? 'active' : ''"> </div>
<i class="fa fa-star" aria-hidden="true" ng-if="grid.active"></i> {{ grid.name }}
</a>
</div>-->
</div> </div>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<div class="form-group"> <div class="form-group">
<label translate>birthdate</label> <label translate>birthdate</label>
<p class="input-group"> <p class="input-group">
<input type="text" class="form-control" datepicker-popup=" {{ 'day_format' | translate }}" ng-model="formUser.birthdate" placeholder="{{ 'birthdate' | translate }}" is-open="opened" close-text="{{'close' | translate}}" required /> <input type="text" class="form-control" datepicker-popup=" {{ 'day_format' | translate }}" ng-model="formUser.birthdate" placeholder="{{ 'birthdate' | translate }}" is-open="opened" close-text="{{'close' | translate}}" max-date="maxDate" required />
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openCalendar($event)"><i class="glyphicon glyphicon-calendar"></i></button> <button type="button" class="btn btn-default" ng-click="openCalendar($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span> </span>
......
...@@ -1151,6 +1151,9 @@ input.editable.grid-name { ...@@ -1151,6 +1151,9 @@ input.editable.grid-name {
.grid-panel-select-optionactive{ .grid-panel-select-optionactive{
background-color:#c5e4c5; background-color:#c5e4c5;
} }
.grid-panel-select-optioninactive{
background-color: transparent;
}
.grid-panel-select-optionselected{ .grid-panel-select-optionselected{
background-color:#c5e4c5; background-color:#c5e4c5;
} }
......
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