Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9865ef53
authored
Jan 12, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'develop'
parents
7e78e312
8f1ecc7d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
39 deletions
sails/roles/database/files/pictodb-schema.sql
sails/src/api/controllers/StudentController.js
sails/src/api/models/Student.js
sails/src/api/models/Supervisor.js
sails/src/assets/scripts/modules/student/views/collections.html
sails/src/assets/styles/main.css
sails/roles/database/files/pictodb-schema.sql
View file @
9865ef53
...
...
@@ -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`
--
...
...
@@ -174,20 +158,6 @@ CREATE TABLE IF NOT EXISTS `picto` (
)
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)"
;
-- --------------------------------------------------------
--
-- 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`
-- NOT IN USE (candidate for removal)
...
...
sails/src/api/controllers/StudentController.js
View file @
9865ef53
...
...
@@ -171,7 +171,7 @@ module.exports = {
License
.
activate
(
params
.
license_number
,
created
.
id
,
function
(
err
,
license
)
{
if
(
err
)
return
res
.
serverError
(
err
);
created
=
created
.
to
Object
();
created
=
created
.
to
JSON
();
created
.
license
=
license
.
toObject
();
return
res
.
ok
(
created
);
});
...
...
sails/src/api/models/Student.js
View file @
9865ef53
...
...
@@ -176,7 +176,6 @@ module.exports = {
},
legend
:
false
,
legend_size
:
'normal'
,
pic
:
"defaultAvatar.jpg"
,
size
:
'large'
,
picto_background
:
'#0000ff'
,
tape_background
:
'#00ffff'
,
...
...
@@ -202,9 +201,6 @@ module.exports = {
}
});
}
if
(
typeof
validAttributes
.
pic
!==
'string'
)
{
delete
validAttributes
.
pic
;
}
if
(
typeof
validAttributes
.
input_selection
!==
'object'
)
{
delete
validAttributes
.
input_selection
;
}
else
{
...
...
@@ -245,7 +241,7 @@ module.exports = {
beforeCreate
:
function
(
attrs
,
next
)
{
attrs
.
attributes
=
Student
.
getValidAttributes
(
attrs
.
attributes
);
attrs
.
password
=
bcrypt
.
hashSync
(
attrs
.
password
,
bcrypt
.
genSaltSync
());
attrs
.
pic
=
sails
.
config
.
pictogram
.
urls
.
getStudentAvatarUrl
()
;
attrs
.
pic
=
sails
.
config
.
pictogram
.
paths
.
defaultAvatarFileName
;
next
();
},
...
...
@@ -519,7 +515,9 @@ module.exports = {
username
:
Math
.
floor
((
Math
.
random
()
*
100000000
)
+
1
)
+
"_"
+
student
.
username
,
id_off
:
null
})
.
then
((
updated
)
=>
{
cb
()})
.
then
((
updated
)
=>
{
License
.
destroy
({
id_stu
:
id_stu
}).
exec
(
cb
);
})
.
catch
((
err
)
=>
{
cb
(
err
)});
});
}
...
...
sails/src/api/models/Supervisor.js
View file @
9865ef53
...
...
@@ -235,7 +235,7 @@ module.exports = {
async
.
eachSeries
(
stuSups
,
function
(
stuSup
,
next_cb
)
{
// Filter logically deleted students
if
(
stuSup
.
student
.
office
==
null
)
next_cb
();
return
next_cb
();
// set current method and instruction if any
Student
.
findOne
(
stuSup
.
student
.
id
)
...
...
sails/src/assets/scripts/modules/student/views/collections.html
View file @
9865ef53
...
...
@@ -153,7 +153,17 @@
}"
/>
<div
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"
>
<i
ng-class=
"{
...
...
@@ -164,6 +174,41 @@
aria-hidden=
"true"
title=
"{{ studentPicto.attributes.status | translate}}"
></i>
</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
class=
"clearfix"
></div>
...
...
sails/src/assets/styles/main.css
View file @
9865ef53
...
...
@@ -470,6 +470,8 @@ textarea.editable{
.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-normal
{
position
:
absolute
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment