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
684caa78
authored
Jan 26, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed some bugs
parent
7511ebdf
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
87 additions
and
27 deletions
sails/src/api/controllers/StudentController.js
sails/src/api/models/Picto.js
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/app/js/services/services.js
sails/src/assets/app/modules/admin/views/admin.html
sails/src/assets/app/modules/login/views/login.html
sails/src/assets/app/modules/login/views/login_admin.html
sails/src/assets/app/modules/login/views/login_setting_password.html
sails/src/assets/app/modules/login/views/signin.html
sails/src/assets/app/modules/student/controllers/addpicto.js
sails/src/assets/app/modules/student/controllers/collections.js
sails/src/assets/app/modules/student/views/addpicto.html
sails/src/assets/app/modules/student/views/collections.html
sails/src/assets/app/modules/supervisor/controllers/students.js
sails/src/assets/app/modules/supervisor/views/setup.html
sails/src/assets/app/modules/supervisor/views/students.html
sails/src/assets/app/modules/supervisor/views/supervisor.html
sails/src/api/controllers/StudentController.js
View file @
684caa78
...
@@ -843,6 +843,22 @@ module.exports = {
...
@@ -843,6 +843,22 @@ module.exports = {
});
});
},
},
//
// Returns the last instruction for the student
//
last_instruction
:
function
(
req
,
res
)
{
if
(
!
req
.
params
.
id_stu
)
return
res
.
json
(
400
,
{
err
:
'id_stu parameter is missing'
});
VStuLastInstruction
.
find
({
id_stu
:
req
.
params
.
id_stu
}).
exec
(
function
(
err
,
found
)
{
if
(
err
)
return
res
.
json
(
500
,
err
);
if
(
!
found
)
return
res
.
json
({});
return
res
.
json
(
found
);
});
},
//
//
// Test raw sql on models
// Test raw sql on models
sqlquery
:
function
(
req
,
res
)
{
sqlquery
:
function
(
req
,
res
)
{
...
...
sails/src/api/models/Picto.js
View file @
684caa78
...
@@ -71,11 +71,13 @@ module.exports = {
...
@@ -71,11 +71,13 @@ module.exports = {
//
//
categories
:
function
(
id_sup
,
id_cat
,
callback
)
{
categories
:
function
(
id_sup
,
id_cat
,
callback
)
{
Supervisor
.
findOne
(
id_sup
).
exec
(
function
(
err
,
sup
)
{
Supervisor
.
findOne
(
id_sup
).
exec
(
function
(
err
,
sup
)
{
if
(
err
)
if
(
err
)
{
console
.
log
(
"Error retrieving categories for supervisor "
+
id_sup
+
": "
+
err
);
return
callback
(
err
,
{});
return
callback
(
err
,
{});
}
// 0 for the main categories --> null in DB
// 0 for the main categories --> null in DB
if
(
id_cat
==
0
)
id_cat
=
null
;
//
if(id_cat == 0) id_cat = null;
PictoCat
.
find
({
id_supercat
:
id_cat
}).
populate
(
'exps'
,
{
lang
:
sup
.
lang
}).
exec
(
function
(
err
,
pictoCats
)
{
PictoCat
.
find
({
id_supercat
:
id_cat
}).
populate
(
'exps'
,
{
lang
:
sup
.
lang
}).
exec
(
function
(
err
,
pictoCats
)
{
if
(
err
||
!
pictoCats
||
pictoCats
.
length
==
0
)
if
(
err
||
!
pictoCats
||
pictoCats
.
length
==
0
)
...
@@ -91,9 +93,11 @@ module.exports = {
...
@@ -91,9 +93,11 @@ module.exports = {
//
//
fromcategory
:
function
(
id_sup
,
id_cat
,
callback
)
{
fromcategory
:
function
(
id_sup
,
id_cat
,
callback
)
{
Supervisor
.
findOne
(
id_sup
).
exec
(
function
(
err
,
sup
)
{
Supervisor
.
findOne
(
id_sup
).
exec
(
function
(
err
,
sup
)
{
if
(
err
)
if
(
err
)
{
console
.
log
(
"Error retrieving categories for supervisor "
+
id_sup
+
": "
+
err
);
return
callback
(
err
,
{});
return
callback
(
err
,
{});
}
Picto
.
find
({
category
:
id_cat
}).
populate
(
'expressions'
,
{
lang
:
sup
.
lang
}).
exec
(
function
(
err
,
pictos
)
{
Picto
.
find
({
category
:
id_cat
}).
populate
(
'expressions'
,
{
lang
:
sup
.
lang
}).
exec
(
function
(
err
,
pictos
)
{
if
(
err
||
!
pictos
||
pictos
.
length
==
0
)
if
(
err
||
!
pictos
||
pictos
.
length
==
0
)
return
callback
(
err
,
{});
return
callback
(
err
,
{});
...
...
sails/src/assets/app/i18n/en-gb.json
View file @
684caa78
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
"child"
:
"Child"
,
"child"
:
"Child"
,
"click"
:
"Click"
,
"click"
:
"Click"
,
"click_login"
:
"Click to login"
,
"click_login"
:
"Click to login"
,
"close"
:
"Close"
,
"collections"
:
"Collections"
,
"collections"
:
"Collections"
,
"confirmation"
:
"Are you sure?"
,
"confirmation"
:
"Are you sure?"
,
"contact_person"
:
"Contact person"
,
"contact_person"
:
"Contact person"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
684caa78
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
"child"
:
"Niño"
,
"child"
:
"Niño"
,
"click"
:
"Clic"
,
"click"
:
"Clic"
,
"click_login"
:
"Clic para iniciar sesión"
,
"click_login"
:
"Clic para iniciar sesión"
,
"close"
:
"Cerrar"
,
"collections"
:
"Colecciones"
,
"collections"
:
"Colecciones"
,
"confirmation"
:
"¿Estás seguro?"
,
"confirmation"
:
"¿Estás seguro?"
,
"contact_person"
:
"Persona de contacto"
,
"contact_person"
:
"Persona de contacto"
,
...
...
sails/src/assets/app/js/services/services.js
View file @
684caa78
...
@@ -22,7 +22,7 @@ angular.module('dashboardServices', [])
...
@@ -22,7 +22,7 @@ angular.module('dashboardServices', [])
responseError
:
function
(
rejection
)
{
responseError
:
function
(
rejection
)
{
if
(
rejection
.
status
===
401
)
{
if
(
rejection
.
status
===
401
)
{
// handle the case where the user is not authenticated
// handle the case where the user is not authenticated
console
.
log
(
"e
errrorrrr
r 401"
);
console
.
log
(
"e
rro
r 401"
);
// send "logout" to children controllers so main.js controller can catch it and logout
// send "logout" to children controllers so main.js controller can catch it and logout
$rootScope
.
$broadcast
(
'logout'
,
null
);
$rootScope
.
$broadcast
(
'logout'
,
null
);
...
...
sails/src/assets/app/modules/admin/views/admin.html
View file @
684caa78
<div
class=
"container"
ng-controller=
"AdminCtrl"
>
<!-- AdminCtrl controls here, see app.js -->
<div
class=
"container"
>
<!-- Admin header -->
<!-- Admin header -->
<header-admin></header-admin>
<header-admin></header-admin>
...
...
sails/src/assets/app/modules/login/views/login.html
View file @
684caa78
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
<img
src=
"img/logo_pictogram.png"
alt=
"Pictogram"
title=
"Pictogram"
/>
<img
src=
"img/logo_pictogram.png"
alt=
"Pictogram"
title=
"Pictogram"
/>
</p>
</p>
<!-- Formulario -->
<!-- Formulario -->
<form
name=
"loginForm"
ng-controller=
"LoginCtrl"
ng-submit=
"login()"
novalidate
>
<!-- LoginCtrl controls here, see app.js -->
<form
name=
"loginForm"
ng-submit=
"login()"
novalidate
>
<!-- Alert and success messages -->
<!-- Alert and success messages -->
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-value-name=
"{{name}}"
>
{{message}}
</div>
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-value-name=
"{{name}}"
>
{{message}}
</div>
...
...
sails/src/assets/app/modules/login/views/login_admin.html
View file @
684caa78
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
<img
src=
"img/logo_pictogram.png"
alt=
"Pictogram"
title=
"Pictogram"
/>
<img
src=
"img/logo_pictogram.png"
alt=
"Pictogram"
title=
"Pictogram"
/>
</p>
</p>
<!-- Formulario -->
<!-- Formulario -->
<form
name=
"loginForm"
ng-controller=
"LoginAdminCtrl"
ng-submit=
"login()"
novalidate
>
<!-- LoginAdminCtrl controls here, see app.js -->
<form
name=
"loginForm"
ng-submit=
"login()"
novalidate
>
<!-- Alert and success messages -->
<!-- Alert and success messages -->
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-value-name=
"{{name}}"
>
{{message}}
</div>
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-value-name=
"{{name}}"
>
{{message}}
</div>
...
...
sails/src/assets/app/modules/login/views/login_setting_password.html
View file @
684caa78
<div
class=
"row"
ng-controller=
"LoginSettingPasswordCtrl"
>
<!-- LoggingSettingPasswordCtrl controls here, see app.js -->
<div
class=
"row"
>
<!-- Rejilla 3 elementos de igual ancho -->
<!-- Rejilla 3 elementos de igual ancho -->
<div
class=
"col-md-4"
>
</div>
<div
class=
"col-md-4"
>
</div>
...
...
sails/src/assets/app/modules/login/views/signin.html
View file @
684caa78
<!-- SigningCtrl controls here, see app.js -->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
...
@@ -16,7 +17,7 @@
...
@@ -16,7 +17,7 @@
<!-- Logo Pictogram -->
<!-- Logo Pictogram -->
<!-- Formulario -->
<!-- Formulario -->
<form
name=
"signInForm"
role=
"form"
ng-
controller=
"SignInCtrl"
ng-
submit=
"signin()"
>
<form
name=
"signInForm"
role=
"form"
ng-submit=
"signin()"
>
<!-- Alert and success messages -->
<!-- Alert and success messages -->
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-values=
"{name: formdata.name, surname: formdata.surname, email: formdata.email}"
>
{{message}}
</div>
<div
ng-show=
"{{ 'showmessage' }}"
class=
"alert"
ng-class=
"alert"
translate
translate-values=
"{name: formdata.name, surname: formdata.surname, email: formdata.email}"
>
{{message}}
</div>
...
...
sails/src/assets/app/modules/student/controllers/addpicto.js
View file @
684caa78
...
@@ -44,7 +44,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -44,7 +44,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
console
.
log
(
"Error from API: "
+
data
.
error
);
console
.
log
(
"Error from API: "
+
data
.
error
);
});
});
//
// Load pictos from a category
// Load pictos from a category
//
$scope
.
load_pictos
=
function
(
id_cat
){
$scope
.
load_pictos
=
function
(
id_cat
){
$http
$http
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pic_fromcategory/'
+
id_cat
)
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pic_fromcategory/'
+
id_cat
)
...
@@ -52,15 +54,17 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -52,15 +54,17 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
// Add to list
// Add to list
$scope
.
pictos
=
data
;
$scope
.
pictos
=
data
;
//console.log(JSON.stringify($scope.pictos));
//console.log(JSON.stringify($scope.pictos));
console
.
log
(
"Pictos listed"
);
console
.
log
(
"Pictos listed"
+
data
);
})
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
"Error from API: "
+
data
.
error
);
console
.
log
(
"Error from API: "
+
data
.
error
);
});
});
};
};
//
// Load pictos from owned by the actual supervisor
// Load pictos from owned by the actual supervisor
// TEST --> change with real supervisor pictos
// TEST --> change with real supervisor pictos
//
$scope
.
load_own_pictos
=
function
(){
$scope
.
load_own_pictos
=
function
(){
$http
$http
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pictos'
)
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pictos'
)
...
@@ -75,7 +79,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -75,7 +79,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
});
});
};
};
//
// Load the folders of a category
// Load the folders of a category
//
$scope
.
load_category
=
function
(
id_cat
){
$scope
.
load_category
=
function
(
id_cat
){
$http
$http
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pic_categories/'
+
id_cat
)
.
get
(
config
.
backend
+
'/sup/'
+
$scope
.
sup
.
id
+
'/pic_categories/'
+
id_cat
)
...
@@ -89,7 +95,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -89,7 +95,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
});
});
};
};
//
// Request folders of a category from the panel (symbolstx)
// Request folders of a category from the panel (symbolstx)
//
$scope
.
open_category
=
function
(
cat
)
{
$scope
.
open_category
=
function
(
cat
)
{
// Add to breadcrumbs
// Add to breadcrumbs
$scope
.
breadcrumbs
.
push
({
$scope
.
breadcrumbs
.
push
({
...
@@ -102,7 +110,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -102,7 +110,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
$scope
.
load_pictos
(
cat
.
id
);
$scope
.
load_pictos
(
cat
.
id
);
};
};
//
// Request folders of a category from the breadcrumbs (symbolstx)
// Request folders of a category from the breadcrumbs (symbolstx)
//
$scope
.
open_category_from_bc
=
function
(
id_cat
)
{
$scope
.
open_category_from_bc
=
function
(
id_cat
)
{
// Delete from breadcrumbs
// Delete from breadcrumbs
...
@@ -119,11 +129,16 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -119,11 +129,16 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
$scope
.
alert
=
{
type
:
'danger'
,
msg
:
'Category is full of pictos.'
,
show
:
false
};
$scope
.
alert
=
{
type
:
'danger'
,
msg
:
'Category is full of pictos.'
,
show
:
false
};
//
// Close alert message
//
$scope
.
closeAlert
=
function
()
{
$scope
.
closeAlert
=
function
()
{
$scope
.
alert
.
show
=
false
;
$scope
.
alert
.
show
=
false
;
};
};
//
// Upload to own supervisor collection when a picto is selected from file
// Upload to own supervisor collection when a picto is selected from file
//
$scope
.
onPictoSelect
=
function
(
$files
)
{
$scope
.
onPictoSelect
=
function
(
$files
)
{
//$files: an array of files selected, each file has name, size, and type.
//$files: an array of files selected, each file has name, size, and type.
for
(
var
i
=
0
;
i
<
$files
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
$files
.
length
;
i
++
)
{
...
@@ -165,7 +180,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -165,7 +180,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
}
}
};
};
//
// Add a picto to student when it is dropped into a category
// Add a picto to student when it is dropped into a category
//
$scope
.
handleDropAddPicto
=
function
(
origin
,
destination
)
{
$scope
.
handleDropAddPicto
=
function
(
origin
,
destination
)
{
// Add picto to stu_picto
// Add picto to stu_picto
var
v_dest
=
destination
.
split
(
"_"
);
// 3 values: idcat_coordx_coordy
var
v_dest
=
destination
.
split
(
"_"
);
// 3 values: idcat_coordx_coordy
...
@@ -327,7 +344,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -327,7 +344,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
}
}
};
};
//
// Delete picto added
// Delete picto added
//
$scope
.
remove_picto
=
function
(
stuPicto
,
id_cat
){
$scope
.
remove_picto
=
function
(
stuPicto
,
id_cat
){
console
.
log
(
"delete_studentPicto: "
+
JSON
.
stringify
(
stuPicto
));
console
.
log
(
"delete_studentPicto: "
+
JSON
.
stringify
(
stuPicto
));
...
@@ -369,7 +388,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -369,7 +388,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
};
};
//
// Delete own picto
// Delete own picto
//
$scope
.
remove_own_picto
=
function
(
id_picto
){
$scope
.
remove_own_picto
=
function
(
id_picto
){
console
.
log
(
"delete_picto:"
+
id_picto
);
console
.
log
(
"delete_picto:"
+
id_picto
);
var
deletePicto
=
$window
.
confirm
(
'Are you absolutely sure you want to delete?'
);
var
deletePicto
=
$window
.
confirm
(
'Are you absolutely sure you want to delete?'
);
...
@@ -392,6 +413,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -392,6 +413,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
}
}
};
};
//
//
//
$scope
.
close
=
function
()
{
$scope
.
close
=
function
()
{
$modalInstance
.
close
(
"Ejemplo de elemento devuelto"
);
$modalInstance
.
close
(
"Ejemplo de elemento devuelto"
);
};
};
...
@@ -403,7 +427,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
...
@@ -403,7 +427,9 @@ dashboardControllers.controller('AddPictoCtrl', function ($scope, $modalInstance
$modalInstance
.
dismiss
(
'cancel'
);
$modalInstance
.
dismiss
(
'cancel'
);
};
};
//
// Modal window to open picto expression
// Modal window to open picto expression
//
$scope
.
open_exp
=
function
(
picto
)
{
$scope
.
open_exp
=
function
(
picto
)
{
var
modalInstance
=
$modal
.
open
({
var
modalInstance
=
$modal
.
open
({
...
...
sails/src/assets/app/modules/student/controllers/collections.js
View file @
684caa78
...
@@ -237,7 +237,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -237,7 +237,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
animation
:
true
,
animation
:
true
,
templateUrl
:
'modules/student/views/addpicto.html'
,
templateUrl
:
'modules/student/views/addpicto.html'
,
controller
:
'AddPictoCtrl'
,
controller
:
'AddPictoCtrl'
,
size
:
size
,
size
:
'lg'
,
resolve
:
{
// Passing data to the controller of the window
resolve
:
{
// Passing data to the controller of the window
stu_id
:
function
(){
stu_id
:
function
(){
return
$scope
.
studentData
.
id
;
return
$scope
.
studentData
.
id
;
...
...
sails/src/assets/app/modules/student/views/addpicto.html
View file @
684caa78
...
@@ -115,6 +115,6 @@
...
@@ -115,6 +115,6 @@
</div>
</div>
<!-- End modal-body -->
<!-- End modal-body -->
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
class=
"btn btn-primary"
ng-click=
"close()"
>
Cerrar
</button>
<button
class=
"btn btn-primary"
ng-click=
"close()"
>
{{ 'close' | translate }}
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
sails/src/assets/app/modules/student/views/collections.html
View file @
684caa78
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<!-- Fin de columna vistas por categorías -->
<!-- Fin de columna vistas por categorías -->
<div
class=
"col-md-2 text-right"
>
<div
class=
"col-md-2 text-right"
>
<a
href=
"#"
class=
"btn btn-success btn-sm"
role=
"button"
ng-click=
"open('lg'
)"
>
<a
class=
"btn btn-success btn-sm"
role=
"button"
ng-click=
"open(
)"
>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
<span
translate
>
add_picto
<span>
<span
class=
"glyphicon glyphicon-plus"
aria-hidden=
"true"
></span>
<span
translate
>
add_picto
<span>
</a>
</a>
</div>
</div>
...
...
sails/src/assets/app/modules/supervisor/controllers/students.js
View file @
684caa78
...
@@ -16,20 +16,25 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl($scope, $s
...
@@ -16,20 +16,25 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl($scope, $s
"lang"
:
'es-es'
,
"lang"
:
'es-es'
,
"notes"
:
''
,
"notes"
:
''
,
"pic"
:
"/app/img/default.jpg"
,
"pic"
:
"/app/img/default.jpg"
,
"office"
:
$scope
.
user
.
office
"office"
:
$scope
.
user
.
office
||
{
name
:
""
}
};
};
//
//
// Flags for showing buttons according to role
// Flags for showing buttons according to role
//
//
$scope
.
user
=
JSON
.
parse
(
$window
.
sessionStorage
.
user
);
$scope
.
user
=
JSON
.
parse
(
$window
.
sessionStorage
.
user
);
if
(
$scope
.
user
.
office
&&
$scope
.
user
.
office
.
admin
===
$scope
.
user
.
id
)
// The user is administrator of the office
$scope
.
user
.
isAdmin
=
true
;
if
(
$scope
.
user
.
office
.
currentStudents
>=
$scope
.
user
.
office
.
maxStudents
)
if
(
$scope
.
user
.
office
)
{
$scope
.
num_licenses_left
=
0
;
if
(
$scope
.
user
.
office
.
admin
===
$scope
.
user
.
id
)
// The user is administrator of the office
else
$scope
.
user
.
isAdmin
=
true
;
$scope
.
num_licenses_left
=
$scope
.
user
.
office
.
maxStudents
-
$scope
.
user
.
office
.
currentStudents
;
if
(
$scope
.
user
.
office
.
currentStudents
>=
$scope
.
user
.
office
.
maxStudents
)
$scope
.
num_licenses_left
=
0
;
else
$scope
.
num_licenses_left
=
$scope
.
user
.
office
.
maxStudents
-
$scope
.
user
.
office
.
currentStudents
;
}
else
{
$scope
.
user
.
office
=
{
name
:
""
}
}
//
//
// Get list of supervisor's students
// Get list of supervisor's students
...
@@ -60,7 +65,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl($scope, $s
...
@@ -60,7 +65,7 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl($scope, $s
"lang"
:
'es-es'
,
"lang"
:
'es-es'
,
"notes"
:
''
,
"notes"
:
''
,
"pic"
:
"/app/img/default.jpg"
,
"pic"
:
"/app/img/default.jpg"
,
"office"
:
$scope
.
user
.
office
,
"office"
:
$scope
.
user
.
office
||
{
name
:
""
}
,
"current_method"
:
"no_method"
,
"current_method"
:
"no_method"
,
"current_instruction"
:
"no_instruction"
"current_instruction"
:
"no_instruction"
};
};
...
...
sails/src/assets/app/modules/supervisor/views/setup.html
View file @
684caa78
<
div
ng-controller=
"SetupCtrl"
>
<
!-- SetupCtrl controls here, see app.js --
>
<div>
<div
class=
"page-header"
>
<div
class=
"page-header"
>
<h2
translate
>
setup
</h2>
<h2
translate
>
setup
</h2>
</div>
</div>
...
...
sails/src/assets/app/modules/supervisor/views/students.html
View file @
684caa78
<toast></toast>
<toast></toast>
<!-- StudentsCtrl controls here, see app.js -->
<div
class=
"panel panel-default"
ng-controller=
"StudentsCtrl"
>
<div
class=
"panel panel-default"
>
<!-- Default panel contents -->
<!-- Default panel contents -->
<div
class=
"panel-heading"
><h3
class=
"panel-title"
translate
>
students
</h3>
<div
class=
"panel-heading"
><h3
class=
"panel-title"
translate
>
students
</h3>
<span
ng-if=
"user.isAdmin"
>
({{user.office.currentStudents}}/{{user.office.maxStudents}} -
<span
translate=
"licenses_left"
translate-values=
"{number: num_licenses_left}"
></span>
)
</span>
<span
ng-if=
"user.isAdmin"
>
({{user.office.currentStudents}}/{{user.office.maxStudents}} -
<span
translate=
"licenses_left"
translate-values=
"{number: num_licenses_left}"
></span>
)
</span>
...
...
sails/src/assets/app/modules/supervisor/views/supervisor.html
View file @
684caa78
<div
class=
"container"
ng-controller=
"SupervisorCtrl"
>
<!-- SupervisorCtrl controls here, see app.js -->
<div
class=
"container"
>
<header-supervisor></header-supervisor>
<header-supervisor></header-supervisor>
...
...
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