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
77b7ae86
authored
Jul 04, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue
#463
fixed
parent
9123e619
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
13 deletions
.gitignore
android/Pictogram/app/build.gradle
sails/src/api/controllers/StudentController.js
sails/src/api/controllers/SupervisorController.js
sails/src/api/models/Student.js
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/scripts/modules/student/controllers/setup.js
sails/src/assets/scripts/modules/student/views/setup.html
sails/src/assets/scripts/modules/supervisor/controllers/students.js
sails/src/assets/scripts/modules/supervisor/views/students_add.html
.gitignore
View file @
77b7ae86
...
@@ -31,6 +31,10 @@ sails/src/config/ssl/**/*.csr
...
@@ -31,6 +31,10 @@ sails/src/config/ssl/**/*.csr
sails/src/config/local.js
sails/src/config/local.js
sails/src/node_modules
sails/src/node_modules
sails/.vagrant
sails/.vagrant
sails/logs/
sails/npm-debug.log
sails/playbook.retry
sails/upload.zip
# Android #
# Android #
###########
###########
...
...
android/Pictogram/app/build.gradle
View file @
77b7ae86
...
@@ -31,7 +31,7 @@ android {
...
@@ -31,7 +31,7 @@ android {
resValue
"integer"
,
"netservice_timing"
,
"20"
resValue
"integer"
,
"netservice_timing"
,
"20"
}
}
debug
{
debug
{
resValue
"string"
,
"server"
,
"https://dev.yottacode.com"
//
resValue "string", "server", "https://dev.yottacode.com"
resValue
"bool"
,
"force_db_create"
,
"false"
resValue
"bool"
,
"force_db_create"
,
"false"
resValue
"bool"
,
"ssl_connect"
,
"false"
resValue
"bool"
,
"ssl_connect"
,
"false"
resValue
"bool"
,
"force_img_download"
,
"false"
resValue
"bool"
,
"force_img_download"
,
"false"
...
...
sails/src/api/controllers/StudentController.js
View file @
77b7ae86
...
@@ -133,6 +133,7 @@ module.exports = {
...
@@ -133,6 +133,7 @@ module.exports = {
Student
.
create
(
params
)
Student
.
create
(
params
)
.
exec
(
function
(
err
,
created
)
{
.
exec
(
function
(
err
,
created
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
sails
.
log
.
debug
(
err
);
sails
.
log
.
debug
(
err
);
return
res
.
json
(
500
,
err
);
return
res
.
json
(
500
,
err
);
}
}
...
...
sails/src/api/controllers/SupervisorController.js
View file @
77b7ae86
...
@@ -374,10 +374,9 @@ module.exports = {
...
@@ -374,10 +374,9 @@ module.exports = {
student
.
supervision
=
req
.
token
.
office
?
2
:
1
;
student
.
supervision
=
req
.
token
.
office
?
2
:
1
;
return
student
;
return
student
;
});
});
if
(
req
.
token
.
isSupAdmin
&&
req
.
token
.
office
&&
req
.
token
.
office
.
id
)
{
if
(
req
.
token
.
isSupAdmin
&&
req
.
token
.
office
&&
req
.
token
.
office
.
id
)
{
Student
.
find
({
office
:
req
.
token
.
office
.
id
}).
then
(
function
(
officeStudents
)
{
Student
.
find
({
office
:
req
.
token
.
office
.
id
}).
then
(
function
(
officeStudents
)
{
students
.
concat
(
officeStudents
);
students
=
students
.
concat
(
officeStudents
);
students
=
students
.
map
((
student
)
=>
{
students
=
students
.
map
((
student
)
=>
{
student
.
supervision
=
student
.
supervision
||
0
;
student
.
supervision
=
student
.
supervision
||
0
;
return
student
;
return
student
;
...
...
sails/src/api/models/Student.js
View file @
77b7ae86
...
@@ -169,6 +169,8 @@ module.exports = {
...
@@ -169,6 +169,8 @@ module.exports = {
tape_background
:
'#00ffff'
tape_background
:
'#00ffff'
};
};
sails
.
log
.
verbose
(
'Requested attributes for Student'
,
attributes
);
if
(
typeof
attributes
===
'object'
)
{
if
(
typeof
attributes
===
'object'
)
{
Object
.
keys
(
defaultAttributes
).
forEach
((
attribute
)
=>
{
Object
.
keys
(
defaultAttributes
).
forEach
((
attribute
)
=>
{
if
(
defaultAttributes
.
hasOwnProperty
(
attribute
)
&&
attributes
.
hasOwnProperty
(
attribute
))
{
if
(
defaultAttributes
.
hasOwnProperty
(
attribute
)
&&
attributes
.
hasOwnProperty
(
attribute
))
{
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
77b7ae86
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
"error_deleting_picto"
:
"Error deleting picto"
,
"error_deleting_picto"
:
"Error deleting picto"
,
"error_downloading_supervisors"
:
"Error downloading supervisors"
,
"error_downloading_supervisors"
:
"Error downloading supervisors"
,
"error_downloading_offices"
:
"Error downloading offices"
,
"error_downloading_offices"
:
"Error downloading offices"
,
"error_fetching_students"
:
"Error when loading students"
,
"error_only_support_images"
:
"Only images are supported (JPG, PNG or GIF files)"
,
"error_only_support_images"
:
"Only images are supported (JPG, PNG or GIF files)"
,
"error_loading_pictos"
:
"Error loading pictos information"
,
"error_loading_pictos"
:
"Error loading pictos information"
,
"expand_navigation"
:
"Expand navigation"
,
"expand_navigation"
:
"Expand navigation"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
77b7ae86
...
@@ -86,6 +86,7 @@
...
@@ -86,6 +86,7 @@
"error_deleting_picto"
:
"Error borrando el picto"
,
"error_deleting_picto"
:
"Error borrando el picto"
,
"error_downloading_supervisors"
:
"Error al descargar los supervisores"
,
"error_downloading_supervisors"
:
"Error al descargar los supervisores"
,
"error_downloading_offices"
:
"Error al descargar las oficinas"
,
"error_downloading_offices"
:
"Error al descargar las oficinas"
,
"error_fetching_students"
:
"Error al cargar estudiantes"
,
"error_only_support_images"
:
"Sólo se soportan imágenes (ficheros JPG, PNG o GIF)"
,
"error_only_support_images"
:
"Sólo se soportan imágenes (ficheros JPG, PNG o GIF)"
,
"error_loading_pictos"
:
"Error cargando información de los pictos"
,
"error_loading_pictos"
:
"Error cargando información de los pictos"
,
"February"
:
"Febrero"
,
"February"
:
"Febrero"
,
...
...
sails/src/assets/scripts/modules/student/controllers/setup.js
View file @
77b7ae86
...
@@ -78,6 +78,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
...
@@ -78,6 +78,7 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
*/
*/
$scope
.
updateStudent
=
function
()
{
$scope
.
updateStudent
=
function
()
{
var
password
;
var
password
;
var
attrs
;
if
(
$scope
.
formUser
.
password_confirm
||
$scope
.
formUser
.
password
)
{
if
(
$scope
.
formUser
.
password_confirm
||
$scope
.
formUser
.
password
)
{
if
(
$scope
.
formUser
.
password_confirm
===
$scope
.
formUser
.
password
)
{
if
(
$scope
.
formUser
.
password_confirm
===
$scope
.
formUser
.
password
)
{
...
@@ -90,7 +91,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
...
@@ -90,7 +91,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
}
}
}
}
$http
.
put
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
,
{
attrs
=
{
birthdate
:
$scope
.
formUser
.
birthdate
,
birthdate
:
$scope
.
formUser
.
birthdate
,
country
:
$scope
.
formUser
.
country
,
country
:
$scope
.
formUser
.
country
,
gender
:
$scope
.
formUser
.
gender
,
gender
:
$scope
.
formUser
.
gender
,
...
@@ -99,8 +101,12 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
...
@@ -99,8 +101,12 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
notes
:
$scope
.
formUser
.
notes
,
notes
:
$scope
.
formUser
.
notes
,
surname
:
$scope
.
formUser
.
surname
,
surname
:
$scope
.
formUser
.
surname
,
username
:
$scope
.
formUser
.
username
,
username
:
$scope
.
formUser
.
username
,
password
:
password
};
})
if
(
password
)
attrs
.
password
=
password
;
$http
.
put
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
,
attrs
)
.
success
(
function
(
data
)
{
.
success
(
function
(
data
)
{
$translate
(
'student_updated'
).
then
(
function
(
translation
)
{
$translate
(
'student_updated'
).
then
(
function
(
translation
)
{
ngToast
.
success
({
content
:
translation
});
ngToast
.
success
({
content
:
translation
});
...
...
sails/src/assets/scripts/modules/student/views/setup.html
View file @
77b7ae86
...
@@ -49,7 +49,12 @@
...
@@ -49,7 +49,12 @@
</select>
</select>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"text"
class=
"form-control"
id=
"student_country"
placeholder=
"{{ 'country' | translate }}"
ng-model=
"formUser.country"
/>
<select
class=
"form-control"
name=
"student_country"
id=
"student_country"
ng-model=
"formUser.country"
required
>
<option
value=
"ES"
>
España
</option>
<option
value=
"US"
>
United States
</option>
<option
value=
"UK"
>
United Kingdom
</option>
<option
value=
"IE"
>
Ireland
</option>
</select>
</div>
</div>
</fieldset>
</fieldset>
...
...
sails/src/assets/scripts/modules/supervisor/controllers/students.js
View file @
77b7ae86
...
@@ -53,7 +53,9 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
...
@@ -53,7 +53,9 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
$scope
.
students
=
data
;
$scope
.
students
=
data
;
})
})
.
error
(
function
()
{
.
error
(
function
()
{
// TODO show error with ngToast
$translate
(
'error_fetching_students'
).
then
(
function
(
translation
)
{
ngToast
.
danger
({
content
:
translation
});
});
});
});
// Reset form Student
// Reset form Student
...
@@ -70,7 +72,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
...
@@ -70,7 +72,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
gender
:
'F'
,
gender
:
'F'
,
lang
:
'es-es'
,
lang
:
'es-es'
,
notes
:
''
,
notes
:
''
,
pic
:
'/app/img/default.jpg'
,
office
:
$scope
.
user
.
office
||
{
name
:
''
},
office
:
$scope
.
user
.
office
||
{
name
:
''
},
current_method
:
'no_method'
,
current_method
:
'no_method'
,
current_instruction
:
'no_instruction'
current_instruction
:
'no_instruction'
...
...
sails/src/assets/scripts/modules/supervisor/views/students_add.html
View file @
77b7ae86
<h3
class=
"color_green"
translate
>
add_student
</h3>
<h3
class=
"color_green"
translate
>
add_student
</h3>
<form
name=
"AddStudentForm"
role=
"form"
ng-submit=
"add_student()"
ng-controller=
"StudentAddCtrl"
>
<form
name=
"AddStudentForm"
role=
"form"
ng-submit=
"add_student()"
ng-controller=
"StudentAddCtrl"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
...
@@ -45,7 +45,13 @@
...
@@ -45,7 +45,13 @@
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"text"
class=
"form-control"
id=
"student_country"
placeholder=
"{{ 'country' | translate }}"
ng-model=
"formdatastudent.country"
/>
<legend
translate
>
country
</legend>
<select
class=
"form-control"
name=
"student_country"
id=
"student_country"
ng-model=
"formdatastudent.country"
required
>
<option
value=
"ES"
selected
>
España
</option>
<option
value=
"US"
>
United States
</option>
<option
value=
"UK"
>
United Kingdom
</option>
<option
value=
"IE"
>
Ireland
</option>
</select>
</div>
</div>
</fieldset>
</fieldset>
</div>
</div>
...
@@ -77,4 +83,4 @@
...
@@ -77,4 +83,4 @@
</div>
</div>
</form>
</form>
<hr
/>
<hr
/>
\ No newline at end of file
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