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
9384c71b
authored
Dec 07, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'develop' of
http://scm.ujaen.es/softuno/pictogram
into develop
parents
b909987f
69feb3e7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
7 deletions
sails/src/api/controllers/SupervisorController.js
sails/src/api/models/StuPicto.js
sails/src/api/models/Student.js
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/views/pictoconfig.html
sails/src/assets/scripts/modules/supervisor/controllers/students.js
sails/src/assets/styles/picto-grid.less
sails/src/api/controllers/SupervisorController.js
View file @
9384c71b
...
@@ -95,6 +95,8 @@ module.exports = {
...
@@ -95,6 +95,8 @@ module.exports = {
if
(
!
supervisor
.
isSupAdmin
&&
!
stuSup
)
if
(
!
supervisor
.
isSupAdmin
&&
!
stuSup
)
throw
new
Error
(
"User without students linked to"
);
throw
new
Error
(
"User without students linked to"
);
return
res
.
ok
({
return
res
.
ok
({
user
:
supervisor
,
user
:
supervisor
,
server_time
:
(
new
Date
()).
getTime
(),
server_time
:
(
new
Date
()).
getTime
(),
...
@@ -405,7 +407,7 @@ module.exports = {
...
@@ -405,7 +407,7 @@ module.exports = {
var
students
=
[];
var
students
=
[];
async
.
each
(
stuSups
,
async
.
each
(
stuSups
,
function
(
stuSup
,
cb
)
{
function
(
stuSup
,
cb
)
{
// Filter logically deleted students
// Filter logically deleted students
if
(
stuSup
.
student
.
office
==
null
)
if
(
stuSup
.
student
.
office
==
null
)
cb
();
cb
();
...
...
sails/src/api/models/StuPicto.js
View file @
9384c71b
...
@@ -86,7 +86,9 @@ module.exports = {
...
@@ -86,7 +86,9 @@ module.exports = {
status
:
'invisible'
,
status
:
'invisible'
,
highlight
:
false
,
highlight
:
false
,
color
:
null
,
color
:
null
,
expression
:
null
expression
:
null
,
legend
:
null
,
legend_size
:
'small'
};
};
if
(
typeof
attributes
===
'object'
)
{
if
(
typeof
attributes
===
'object'
)
{
...
@@ -117,6 +119,15 @@ module.exports = {
...
@@ -117,6 +119,15 @@ module.exports = {
if
(
!
((
/^
(
invisible|enabled|disabled
)
$/
).
test
(
validAttributes
.
status
)))
{
if
(
!
((
/^
(
invisible|enabled|disabled
)
$/
).
test
(
validAttributes
.
status
)))
{
delete
validAttributes
.
status
;
delete
validAttributes
.
status
;
}
}
if
(
typeof
validAttributes
.
expression
!==
'string'
)
{
delete
validAttributes
.
expression
;
}
if
(
typeof
validAttributes
.
legend
!==
'boolean'
)
{
delete
validAttributes
.
legend
;
}
if
(
!
((
/^
(
small|large
)
$/
).
test
(
validAttributes
.
legend_size
)))
{
delete
validAttributes
.
legend_size
;
}
if
(
typeof
validAttributes
.
highlight
!==
'boolean'
)
{
if
(
typeof
validAttributes
.
highlight
!==
'boolean'
)
{
delete
validAttributes
.
highlight
;
delete
validAttributes
.
highlight
;
}
}
...
@@ -137,7 +148,7 @@ module.exports = {
...
@@ -137,7 +148,7 @@ module.exports = {
*/
*/
beforeCreate
:
function
(
attrs
,
next
)
{
beforeCreate
:
function
(
attrs
,
next
)
{
if
(
typeof
attrs
.
attributes
!==
'object'
)
{
if
(
typeof
attrs
.
attributes
!==
'object'
)
{
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
}
}
attrs
.
attributes
=
StuPicto
.
getValidAttributes
(
attrs
.
attributes
);
attrs
.
attributes
=
StuPicto
.
getValidAttributes
(
attrs
.
attributes
);
next
();
next
();
...
...
sails/src/api/models/Student.js
View file @
9384c71b
...
@@ -169,6 +169,7 @@ module.exports = {
...
@@ -169,6 +169,7 @@ module.exports = {
},
},
legend
:
false
,
legend
:
false
,
legend_size
:
'normal'
,
legend_size
:
'normal'
,
pic
:
"defaultAvatar.jpg"
,
size
:
'normal'
,
size
:
'normal'
,
picto_background
:
'#0000ff'
,
picto_background
:
'#0000ff'
,
tape_background
:
'#00ffff'
,
tape_background
:
'#00ffff'
,
...
@@ -194,6 +195,9 @@ module.exports = {
...
@@ -194,6 +195,9 @@ 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
{
...
...
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
9384c71b
...
@@ -57,7 +57,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -57,7 +57,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope
.
isCategory
=
function
(
studentPicto
)
{
$scope
.
isCategory
=
function
(
studentPicto
)
{
return
studentPicto
.
attributes
.
id_cat
===
null
&&
return
studentPicto
.
attributes
.
id_cat
===
null
&&
studentPicto
.
attributes
.
coord_
x
!==
0
&&
studentPicto
.
attributes
.
coord_
y
!==
0
&&
typeof
studentPicto
.
attributes
.
free_category_coord_x
!==
'number'
&&
typeof
studentPicto
.
attributes
.
free_category_coord_x
!==
'number'
&&
typeof
studentPicto
.
attributes
.
free_category_coord_y
!==
'number'
;
typeof
studentPicto
.
attributes
.
free_category_coord_y
!==
'number'
;
};
};
...
...
sails/src/assets/scripts/modules/student/views/pictoconfig.html
View file @
9384c71b
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
-->
-->
<li
class=
"list-group-item"
>
<li
class=
"list-group-item"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<
label><input
data-toggle=
"toggle"
type=
"checkbox"
ng-model=
"studentPicto.attributes.legend"
ng-change=
"update_properties()"
translate
>
legend
</label>
<
input
data-toggle=
"toggle"
type=
"checkbox"
ng-model=
"studentPicto.attributes.legend"
ng-change=
"update_properties()"
><label
translate
>
legend
</label>
</div>
</div>
</ul>
</ul>
</div>
</div>
...
...
sails/src/assets/scripts/modules/supervisor/controllers/students.js
View file @
9384c71b
...
@@ -24,7 +24,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
...
@@ -24,7 +24,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
gender
:
'F'
,
gender
:
'F'
,
lang
:
'es-es'
,
lang
:
'es-es'
,
notes
:
''
,
notes
:
''
,
pic
:
'
/app/img/default
.jpg'
,
pic
:
'
defaultAvatar
.jpg'
,
office
:
$scope
.
user
.
office
||
{
name
:
''
}
office
:
$scope
.
user
.
office
||
{
name
:
''
}
};
};
...
...
sails/src/assets/styles/picto-grid.less
View file @
9384c71b
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
&__title {
&__title {
margin-top: 0;
margin-top: 0;
color:
white
;
color:
black
;
text-transform: capitalize;
text-transform: capitalize;
}
}
}
}
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