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
3b6886f9
authored
Dec 10, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
signin form reset after successfull registration
parent
8d89f8dd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
sails/roles/database/files/pictodb-data-coreexp.sql
sails/src/api/controllers/SupervisorController.js
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/modules/login/controllers/signin.js
sails/src/assets/scripts/modules/student/controllers/setup.js
sails/roles/database/files/pictodb-data-coreexp.sql
100755 → 100644
View file @
3b6886f9
File mode changed
sails/src/api/controllers/SupervisorController.js
View file @
3b6886f9
...
...
@@ -400,7 +400,7 @@ module.exports = {
throw
new
Error
(
"Not a valid supervisor"
)
// Get all stu_sup relations
StuSup
.
find
({
supervisor
:
supervisor
.
id
})
StuSup
.
find
({
id_sup
:
supervisor
.
id
})
.
populate
(
'student'
)
.
then
(
function
(
stuSups
)
{
...
...
@@ -428,6 +428,7 @@ module.exports = {
},
function
(
err
)
{}
);
sails
.
debug
.
log
(
"->"
+
students
);
return
students
;
})
.
then
(
function
(
students
)
{
...
...
@@ -449,8 +450,10 @@ module.exports = {
.
catch
(
function
(
err
)
{
res
.
serverError
(
"Error "
+
err
);
});
}
else
}
else
{
sails
.
debug
.
log
(
students
);
res
.
ok
(
students
);
}
})
.
catch
(
err
=>
{
throw
err
});
})
...
...
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
3b6886f9
...
...
@@ -60,7 +60,7 @@ function LoginCtrl(
.
post
(
config
.
backend
+
'/sup/login'
,
$scope
.
credentials
)
.
success
(
function
(
data
)
{
// default logo to Pictogram logo
if
(
data
.
user
.
office
.
logo_url
.
length
<
5
)
if
(
!
data
.
user
.
office
||
data
.
user
.
office
.
logo_url
.
length
<
5
)
data
.
user
.
office
.
logo_url
=
'img/logo_pictogram.png'
;
$window
.
sessionStorage
.
token
=
data
.
token
;
...
...
sails/src/assets/scripts/modules/login/controllers/signin.js
View file @
3b6886f9
...
...
@@ -13,6 +13,8 @@ function SignInCtrl($scope,
config
,
CONSTANTS
,
ngToast
)
{
$scope
.
reset
=
function
()
{
$scope
.
formdata
=
{
name
:
''
,
surname
:
''
,
...
...
@@ -25,8 +27,10 @@ function SignInCtrl($scope,
password_confirm
:
''
,
lang
:
'es-es'
};
};
reCAPTCHA
.
setPublicKey
(
'6LdLjh0TAAAAANblo_KUGNnmRZuIetOkdjdhj1b6'
);
$scope
.
reset
();
// Form submit
$scope
.
signin
=
function
()
{
...
...
@@ -58,6 +62,7 @@ function SignInCtrl($scope,
.
post
(
config
.
backend
+
'/sup'
,
$scope
.
formdata
)
.
success
(
function
()
{
ngToast
.
success
({
content
:
$translate
.
instant
(
'user_created'
)
});
$scope
.
reset
();
})
.
error
(
function
()
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'user_exists'
,
{
email
:
$scope
.
formdata
.
email
})
});
...
...
sails/src/assets/scripts/modules/student/controllers/setup.js
View file @
3b6886f9
...
...
@@ -117,6 +117,12 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
$scope
.
formUser
.
notes
=
data
.
notes
;
$scope
.
formUser
.
surname
=
data
.
surname
;
$scope
.
formUser
.
username
=
data
.
username
;
// websocket emit vocabulary delete action
io
.
socket
.
post
(
'/stu/config'
,
{
action
:
'update'
,
attributes
:
data
},
function
()
{});
})
.
error
(
function
()
{
$translate
.
danger
(
'student_not_updated'
,
function
(
translation
)
{
...
...
@@ -302,6 +308,14 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
$translate
(
'attributes_updated'
).
then
(
function
(
translation
)
{
ngToast
.
success
({
content
:
translation
});
});
// websocket emit vocabulary delete action
io
.
socket
.
post
(
'/stu/config'
,
{
action
:
'update'
,
attributes
:
{
id_stu
:
$scope
.
studentData
.
id
,
attributes
:
$scope
.
studentData
.
attributes
}
},
function
()
{});
})
.
error
(
function
()
{
$translate
(
'attributes_not_updated'
).
then
(
function
(
translation
)
{
...
...
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