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
2de3ba70
authored
Dec 02, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #640 fixed
parent
5d101f73
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
7 deletions
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/supervisor/controllers/students.js
sails/src/assets/scripts/modules/supervisor/views/students.html
sails/src/api/controllers/SupervisorController.js
View file @
2de3ba70
...
...
@@ -405,6 +405,11 @@ module.exports = {
var
students
=
[];
async
.
each
(
stuSups
,
function
(
stuSup
,
cb
)
{
// Filter logically deleted students
if
(
stuSup
.
student
.
office
==
null
)
cb
();
var
student
=
stuSup
.
student
;
student
.
supervision
=
req
.
token
.
office
?
2
:
1
;
VStuLastInstruction
.
findOne
({
student
:
student
.
id
})
...
...
sails/src/api/models/Student.js
View file @
2de3ba70
...
...
@@ -504,7 +504,6 @@ module.exports = {
if
(
err
||
!
student
)
throw
err
;
// set office to NULL to unlink it
student
.
office
=
null
;
student
.
save
(
function
(
err
,
saved
)
{
if
(
err
)
return
cb
(
err
);
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
2de3ba70
...
...
@@ -250,6 +250,7 @@
"state_spontaneous"
:
"Spontaneous"
,
"state_supervised"
:
"Supervised"
,
"student_added"
:
"Student added"
,
"student_already_exists"
:
"A student with that username already exists, please try with another one"
,
"student_deleted"
:
"Student deleted"
,
"student_not_added"
:
"Student not added"
,
"student_not_deleted"
:
"Student not deleted"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
2de3ba70
...
...
@@ -251,6 +251,7 @@
"state_spontaneous"
:
"Espontáneo"
,
"state_supervised"
:
"Guiado"
,
"student_added"
:
"Estudiante añadido"
,
"student_already_exists"
:
"Ya existe un estudiante con ese nombre de usuario. Por favor, inténtelo de nuevo con algo diferente."
,
"student_deleted"
:
"Estudiante eliminado"
,
"student_not_added"
:
"Estudiante no añadido"
,
"student_not_deleted"
:
"No se ha podido eliminar el estudiante"
,
...
...
sails/src/assets/scripts/modules/supervisor/controllers/students.js
View file @
2de3ba70
...
...
@@ -121,7 +121,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
// between the new element created and the form fields
$scope
.
resetForm
();
//
Show
the add form to new adding
//
Hide
the add form to new adding
$scope
.
hidestudentadd
=
true
;
// Update counters
...
...
@@ -130,14 +130,17 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
})
.
error
(
function
(
err
)
{
var
errorMessage
=
'student_not_added'
;
console
.
log
(
err
);
if
(
typeof
err
==
"string"
&&
err
.
search
(
"Maximum number of enrolments reached"
)
>
0
)
errorMessage
=
'max_licenses_reached'
;
if
(
typeof
err
==
"string"
&&
err
.
search
(
"already exists"
)
>
0
)
errorMessage
=
'student_already_exists'
;
else
if
(
err
&&
err
.
status
===
400
)
errorMessage
=
'invalid_fields'
;
ngToast
.
danger
({
content
:
$translate
.
instant
(
errorMessage
)
});
$scope
.
hidestudentadd
=
true
;
});
};
...
...
sails/src/assets/scripts/modules/supervisor/views/students.html
View file @
2de3ba70
...
...
@@ -11,12 +11,11 @@
<!-- Add Student button and Search row -->
<div
class=
"row"
>
<div
class=
"col-xs-3"
>
<p
class=
"text-left"
>
<p
class=
"text-left"
ng-hide=
"!user.isSupAdmin || !num_licenses_left || !hidestudentadd"
>
<a
ng-click=
"resetForm(); hidestudentadd = false"
class=
"btn btn-success btn-sm"
role=
"button"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
{{ 'add_student' | translate }}
</a>
</p>
<!-- <button type="button" class="btn btn-success btn-circle btn-lg" ng-click="resetForm(); hidestudentadd = false" title="{{'add'|translate}}" ng-hide="!user.isSupAdmin || !num_licenses_left"><i class="glyphicon glyphicon-plus"></i></button> -->
</div>
<div
class=
"col-xs-6 input-group"
>
<input
type=
"text"
ng-model=
"search_students"
id=
"search_students"
placeholder=
"{{ 'filter' | translate }}"
class=
"form-control"
aria-describedby=
"basic-addon2"
>
...
...
@@ -37,7 +36,7 @@
</div>
</td>
<td>
<h4>
{{student.
name}} {{student.sur
name}}
</h4>
<h4>
{{student.
surname}}, {{student.
name}}
</h4>
</td>
<td>
<p>
<span>
{{student.current_method | translate}}
</span>
<br
/>
<span
class=
"text-muted"
>
{{student.current_instruction | translate}}
</span>
</p>
...
...
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