Commit 9865ef53 by Arturo Montejo Ráez

Merge branch 'develop'

parents 7e78e312 8f1ecc7d
...@@ -48,22 +48,6 @@ COMMENT="This table registers and action performed by a user at a given time, al ...@@ -48,22 +48,6 @@ COMMENT="This table registers and action performed by a user at a given time, al
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
-- Estructura de tabla para la tabla `catexp`
--
CREATE TABLE IF NOT EXISTS `catexp`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_cat` int(11) NOT NULL,
`lang` char(5),
`exp` varchar(30) NOT NULL,
PRIMARY KEY(`id`),
UNIQUE(exp,lang),
CHECK (lang IN ('es-es','en-gb','en-us'))
)
COMMENT="Stores the expressions available in several languages for a given category (id_cat)";
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `method` -- Estructura de tabla para la tabla `method`
-- --
...@@ -174,20 +158,6 @@ CREATE TABLE IF NOT EXISTS `picto` ( ...@@ -174,20 +158,6 @@ CREATE TABLE IF NOT EXISTS `picto` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=104142 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=104142
COMMENT="Main information about a pictogram, either coming from a source like Symbolstix or added by a supervisor. It can belongs to a category (id_cat)"; COMMENT="Main information about a pictogram, either coming from a source like Symbolstix or added by a supervisor. It can belongs to a category (id_cat)";
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pictocat`
--
CREATE TABLE IF NOT EXISTS `pictocat`(
`id` int(11) PRIMARY KEY,
`id_supercat` int(11)
)
COMMENT="Identifies a category, which, itself, may belong to another category";
-- --------------------------------------------------------
-- --
-- Estructura de tabla para la tabla `picto_acl` -- Estructura de tabla para la tabla `picto_acl`
-- NOT IN USE (candidate for removal) -- NOT IN USE (candidate for removal)
......
...@@ -171,7 +171,7 @@ module.exports = { ...@@ -171,7 +171,7 @@ module.exports = {
License.activate(params.license_number, created.id, function(err, license) { License.activate(params.license_number, created.id, function(err, license) {
if (err) if (err)
return res.serverError(err); return res.serverError(err);
created = created.toObject(); created = created.toJSON();
created.license = license.toObject(); created.license = license.toObject();
return res.ok(created); return res.ok(created);
}); });
......
...@@ -176,7 +176,6 @@ module.exports = { ...@@ -176,7 +176,6 @@ module.exports = {
}, },
legend: false, legend: false,
legend_size: 'normal', legend_size: 'normal',
pic: "defaultAvatar.jpg",
size: 'large', size: 'large',
picto_background: '#0000ff', picto_background: '#0000ff',
tape_background: '#00ffff', tape_background: '#00ffff',
...@@ -202,9 +201,6 @@ module.exports = { ...@@ -202,9 +201,6 @@ module.exports = {
} }
}); });
} }
if (typeof validAttributes.pic !== 'string') {
delete validAttributes.pic;
}
if (typeof validAttributes.input_selection !== 'object') { if (typeof validAttributes.input_selection !== 'object') {
delete validAttributes.input_selection; delete validAttributes.input_selection;
} else { } else {
...@@ -245,7 +241,7 @@ module.exports = { ...@@ -245,7 +241,7 @@ module.exports = {
beforeCreate: function (attrs, next) { beforeCreate: function (attrs, next) {
attrs.attributes = Student.getValidAttributes(attrs.attributes); attrs.attributes = Student.getValidAttributes(attrs.attributes);
attrs.password = bcrypt.hashSync(attrs.password, bcrypt.genSaltSync()); attrs.password = bcrypt.hashSync(attrs.password, bcrypt.genSaltSync());
attrs.pic = sails.config.pictogram.urls.getStudentAvatarUrl(); attrs.pic = sails.config.pictogram.paths.defaultAvatarFileName;
next(); next();
}, },
...@@ -519,7 +515,9 @@ module.exports = { ...@@ -519,7 +515,9 @@ module.exports = {
username: Math.floor((Math.random() * 100000000) + 1) + "_" + student.username, username: Math.floor((Math.random() * 100000000) + 1) + "_" + student.username,
id_off: null id_off: null
}) })
.then((updated) => {cb()}) .then((updated) => {
License.destroy({id_stu: id_stu}).exec(cb);
})
.catch((err) => {cb(err)}); .catch((err) => {cb(err)});
}); });
} }
......
...@@ -235,7 +235,7 @@ module.exports = { ...@@ -235,7 +235,7 @@ module.exports = {
async.eachSeries(stuSups, function(stuSup, next_cb) { async.eachSeries(stuSups, function(stuSup, next_cb) {
// Filter logically deleted students // Filter logically deleted students
if (stuSup.student.office == null) if (stuSup.student.office == null)
next_cb(); return next_cb();
// set current method and instruction if any // set current method and instruction if any
Student.findOne(stuSup.student.id) Student.findOne(stuSup.student.id)
......
...@@ -153,7 +153,17 @@ ...@@ -153,7 +153,17 @@
}"/> }"/>
<div <div
class="picto_options" class="picto_options"
ng-if="studentPicto !== emptyStudentPicto"> 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"
ng-if="studentPicto !== emptyStudentPicto && studentPicto.attributes.coord_y != '0'">
<a ng-click="view_picto(studentPicto)" class="picto_ok" > <a ng-click="view_picto(studentPicto)" class="picto_ok" >
<i <i
ng-class="{ ng-class="{
...@@ -164,6 +174,41 @@ ...@@ -164,6 +174,41 @@
aria-hidden="true" aria-hidden="true"
title="{{ studentPicto.attributes.status | translate}}"></i> title="{{ studentPicto.attributes.status | translate}}"></i>
</a> </a>
<a
ng-click=""
class="picto_cat_edit">
<i class="glyphicon glyphicon-picture" aria-hidden="true"></i>
</a>
</div>
<div
class="picto_options"
ng-if="studentPicto !== emptyStudentPicto && studentPicto.attributes.coord_y == '0'">
<a
ng-click="delete_picto(studentPicto)"
class="picto_remove"
title="{{ 'delete' | translate}}">
<i class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></i>
</a>
<a ng-click="view_picto(studentPicto)" class="picto_ok" >
<i ng-class="{
color_green: studentPicto.attributes.status == 'invisible',
color_black: studentPicto.attributes.status == 'enabled'
}"
class="glyphicon glyphicon-eye-open"
aria-hidden="true"
title="{{ studentPicto.attributes.status | translate}}">
</i>
</a>
<a
class="picto_tags"
ng-click="open_tags(studentPicto)">
<i class="glyphicon glyphicon-tags" aria-hidden="true"></i>
</a>
<a
class="picto_config"
ng-click="open_config(studentPicto)">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
</a>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
......
...@@ -470,6 +470,8 @@ textarea.editable{ ...@@ -470,6 +470,8 @@ textarea.editable{
.picto .picto_options .picto_minus{ position: absolute; top: 2px; right: 2px; } .picto .picto_options .picto_minus{ position: absolute; top: 2px; right: 2px; }
.picto .picto_options .picto_cat_edit{ position: absolute; top: 2px; left: 2px; }
/* Picto legend */ /* Picto legend */
.picto-legend-normal { .picto-legend-normal {
position: absolute; position: absolute;
......
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