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
9b72eb59
authored
Aug 03, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
alta y login para tutor y therapist funcionando
parent
ed54ade1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
47 deletions
sails/src/api/models/Supervisor.js
sails/src/assets/scripts/controllers/main.js
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/modules/login/views/login.html
sails/src/assets/scripts/modules/supervisor/controllers/setup.js
sails/src/assets/scripts/modules/supervisor/controllers/supervisor.js
sails/src/assets/scripts/modules/supervisor/views/header.html
sails/src/api/models/Supervisor.js
View file @
9b72eb59
...
...
@@ -221,7 +221,6 @@ module.exports = {
var
l
=
[];
Supervisor
.
findOne
(
id
)
.
populate
(
'office'
)
.
then
(
function
(
sup
)
{
if
(
!
sup
)
throw
new
Error
(
"Not a valid supervisor"
)
...
...
@@ -265,38 +264,9 @@ module.exports = {
next_cb
();
});
},
function
(
err
)
{
// loop has end
// Get all students from the office if user is administrator
if
(
sup
.
office
&&
sup
.
office
.
admin
==
sup
.
id
)
{
var
officeStudents
;
Student
.
find
({
office
:
sup
.
office
.
id
})
.
populate
(
'lastInstruction'
)
.
populate
(
'license'
)
.
then
(
function
(
officeStudents
)
{
officeStudents
=
officeStudents
.
map
((
student
)
=>
{
student
.
supervision
=
0
;
student
.
current_method
=
student
.
lastInstruction
[
0
]
?
student
.
lastInstruction
[
0
].
met_name
:
"no_method"
;
student
.
current_instruction
=
student
.
lastInstruction
[
0
]
?
student
.
lastInstruction
[
0
].
ins_name
:
"no_instruction"
;
if
(
typeof
(
student
.
license
[
0
])
!=
'undefined'
)
{
student
.
licenseIsValid
=
new
Date
(
student
.
license
[
0
].
expiration_ts
)
-
new
Date
()
>
0
?
true
:
false
;
student
.
license
=
student
.
license
[
0
];
}
else
{
student
.
licenseIsValid
=
false
;
student
.
license
=
null
;
}
return
student
;
});
l
=
l
.
concat
(
officeStudents
);
callback
(
err
,
lodash
.
uniq
(
l
,
false
,
'id'
));
})
.
catch
(
function
(
err
)
{
callback
(
err
,
l
);
});
}
else
{
function
(
err
)
{
callback
(
err
,
l
);
}
});
// end async.eachSeries
});
})
.
catch
((
err
)
=>
{
callback
(
err
,
l
);
...
...
sails/src/assets/scripts/controllers/main.js
View file @
9b72eb59
...
...
@@ -32,8 +32,9 @@ dashboardControllers.controller('MainCtrl', function MainCtrl($scope, $window, $
id
:
''
,
name
:
''
,
surname
:
''
,
email
:
''
,
role
:
''
,
pic
:
''
,
office
:
''
,
lang
:
''
};
...
...
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
9b72eb59
...
...
@@ -77,16 +77,10 @@ function LoginCtrl(
$translate
.
use
(
$scope
.
lang
);
}
else
{
$translate
.
use
(
$scope
.
lang
);
$location
.
path
(
'/sup/login'
);
}
// Change
$window
.
sessionStorage
.
user
=
JSON
.
stringify
(
data
.
user
);
ngToast
.
success
(
$translate
(
'login_success'
));
// Name in login success message
$scope
.
name
=
data
.
user
.
name
||
data
.
user
.
email
;
// Redirección
$location
.
path
(
'/students'
);
})
.
error
(
function
(
err
)
{
...
...
sails/src/assets/scripts/modules/login/views/login.html
View file @
9b72eb59
...
...
@@ -270,7 +270,6 @@
</div>
<fieldset>
<label
translate
>
password
</label>
<span
class=
"color_red text_sm pull-right"
ng-show=
"formdata.password != formdata.password_confirm"
translate
>
password_match
</span>
<div
class=
"form-group"
>
<input
type=
"password"
class=
"form-control"
id=
"signin_password1"
placeholder=
"{{ 'password_type' | translate }}"
name=
"password"
required
ng-model=
"formdata.password"
/>
<span
class=
"color_red text_sm pull-right"
ng-show=
"formdata.password.length < minlength && forms.officeForm.password.$dirty && forms.officeForm.password_confirm.$dirty"
>
{{ 'password_short' | translate:'{ minlength: minlength }' }}
</span>
...
...
sails/src/assets/scripts/modules/supervisor/controllers/setup.js
View file @
9b72eb59
...
...
@@ -124,6 +124,8 @@ dashboardControllers.controller('SetupCtrl', function SetupCtrl(
user
.
phone
=
data
.
phone
;
user
.
email
=
data
.
email
;
user
.
lang
=
data
.
lang
;
user
.
pic
=
data
.
pic
;
user
.
role
=
data
.
role
;
// Delete because at the beginning the variable user is bind
// with the form
...
...
sails/src/assets/scripts/modules/supervisor/controllers/supervisor.js
View file @
9b72eb59
...
...
@@ -25,8 +25,8 @@ dashboardControllers.controller('SupervisorCtrl', function SupervisorCtrl(
// Assign values this way (like an object) to ensure it's the parent scope
$scope
.
user
.
id
=
user
.
id
;
$scope
.
user
.
role
=
user
.
role
;
$scope
.
user
.
name
=
user
.
name
;
$scope
.
user
.
surname
=
user
.
surname
;
$scope
.
user
.
name
=
user
.
name
||
$translate
.
instant
(
'name'
)
;
$scope
.
user
.
surname
=
user
.
surname
||
$translate
.
instant
(
'surname'
)
;
$scope
.
user
.
pic
=
user
.
pic
;
$scope
.
user
.
lang
=
user
.
lang
;
$scope
.
user
.
isOffice
=
user
.
isOffice
;
...
...
sails/src/assets/scripts/modules/supervisor/views/header.html
View file @
9b72eb59
...
...
@@ -8,16 +8,15 @@
href=
"/app/#/students"
>
<img
class=
"topbar__logo__image"
ng-src=
"{{user.office.logoUrl}}
"
alt=
"
{{user.office.name}}
"
title=
"
{{user.office.name}}
"
/>
src=
"/app/img/logo_pictogram.png
"
alt=
"
Pîctogram
"
title=
"
Pictogram
"
/>
</a>
</div>
<div
class=
"topbar__supervisor nav navbar-nav navbar-right"
>
<div
class=
"dropdown"
>
<div
class=
"topbar__supervisor__name"
>
<div
class=
"topbar__supervisor__name__fullname"
>
{{user.getFullName()}}
</div>
<div
class=
"topbar__supervisor__name__office"
>
{{user.office.name}}
</div>
</div>
<div
class=
"topbar__supervisor__avatar thumbnail"
...
...
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