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
0bf177f4
authored
Dec 28, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #723 fixed
parent
8a83f625
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
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/app/i18n/en-gb.json
View file @
0bf177f4
...
@@ -288,6 +288,7 @@
...
@@ -288,6 +288,7 @@
"student_pictograms"
:
"Student's pictograms"
,
"student_pictograms"
:
"Student's pictograms"
,
"student_updated"
:
"Student updated"
,
"student_updated"
:
"Student updated"
,
"students"
:
"Students"
,
"students"
:
"Students"
,
"sup_already_added"
:
"Supervisor already in the list"
,
"sup_not_added"
:
"Supervisor not added to the student"
,
"sup_not_added"
:
"Supervisor not added to the student"
,
"sup_not_deleted"
:
"The supervisor couldn't be deleted by the student"
,
"sup_not_deleted"
:
"The supervisor couldn't be deleted by the student"
,
"sup_not_found"
:
"There is no supervisor account in Pictogram with this email"
,
"sup_not_found"
:
"There is no supervisor account in Pictogram with this email"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
0bf177f4
...
@@ -289,6 +289,7 @@
...
@@ -289,6 +289,7 @@
"student_pictograms"
:
"Pictogramas del estudiante"
,
"student_pictograms"
:
"Pictogramas del estudiante"
,
"student_updated"
:
"Estudiante actualizado"
,
"student_updated"
:
"Estudiante actualizado"
,
"students"
:
"Alumnos"
,
"students"
:
"Alumnos"
,
"sup_already_added"
:
"El supervisor ya está en la lista"
,
"sup_not_added"
:
"El supervisor no se ha podido añadir al estudiante."
,
"sup_not_added"
:
"El supervisor no se ha podido añadir al estudiante."
,
"sup_not_deleted"
:
"El supervisor no se ha podido desvincular del alumno."
,
"sup_not_deleted"
:
"El supervisor no se ha podido desvincular del alumno."
,
"sup_not_found"
:
"No hay ningún usuario en Pictogram con ese correo electrónico."
,
"sup_not_found"
:
"No hay ningún usuario en Pictogram con ese correo electrónico."
,
...
...
sails/src/assets/scripts/modules/student/controllers/setup.js
View file @
0bf177f4
...
@@ -183,22 +183,30 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
...
@@ -183,22 +183,30 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
supervisor
:
$scope
.
supToAdd
.
id
supervisor
:
$scope
.
supToAdd
.
id
};
};
// Ensure supervisor is not already in the list
if
(
$scope
.
studentSupervisors
.
map
((
s
)
=>
s
.
id
).
includes
(
$scope
.
supToAdd
.
id
))
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'sup_already_added'
)
});
$scope
.
supsForm
.
email_sup
=
''
;
$scope
.
showmessagesupfound
=
false
;
return
;
}
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/sup/'
+
$scope
.
supToAdd
.
id
,
{
asTherapist
:
true
})
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/sup/'
+
$scope
.
supToAdd
.
id
,
{
asTherapist
:
true
})
.
success
(
function
(
data
)
{
.
success
(
function
(
data
)
{
// Assign the info of supervisor to add
// Assign the info of supervisor to add
stusup
.
supervisor
=
$scope
.
supToAdd
;
stusup
.
supervisor
=
$scope
.
supToAdd
;
stusup
.
id
=
data
.
id
;
stusup
.
id
=
data
.
id
;
// Add to the list of tutors in view
// Add to the list of tutors in view
$scope
.
studentSupervisors
.
push
(
$scope
.
supToAdd
);
$scope
.
studentSupervisors
.
push
(
$scope
.
supToAdd
);
// Delete the email form field
// Delete the email form field
$scope
.
supsForm
.
email_sup
=
''
;
$scope
.
supsForm
.
email_sup
=
''
;
// Hide the message of supervisor founded
// Hide the message of supervisor founded
$scope
.
showmessagesupfound
=
false
;
$scope
.
showmessagesupfound
=
false
;
})
})
.
error
(
function
()
{
.
error
(
function
()
{
$translate
(
'sup_not_added'
).
then
(
function
(
translation
)
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'sup_not_added'
)
});
ngToast
.
danger
({
content
:
translation
});
});
});
});
};
};
...
@@ -262,6 +270,14 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
...
@@ -262,6 +270,14 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
supervisor
:
$scope
.
tutorToAdd
.
id
supervisor
:
$scope
.
tutorToAdd
.
id
};
};
// Ensure supervisor is not already in the list
if
(
$scope
.
studentTutors
.
map
((
s
)
=>
s
.
id
).
includes
(
$scope
.
tutorToAdd
.
id
))
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'sup_already_added'
)
});
$scope
.
supsForm
.
email_tutor
=
''
;
$scope
.
showmessagetutorfound
=
false
;
return
;
}
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/sup/'
+
$scope
.
tutorToAdd
.
id
)
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/sup/'
+
$scope
.
tutorToAdd
.
id
)
.
success
(
function
(
data
)
{
.
success
(
function
(
data
)
{
// Assign the info of supervisor to add
// Assign the info of supervisor to add
...
...
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