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
8367f4c3
authored
Aug 03, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Signup form for tutors ready
parent
71a8171b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
14 deletions
sails/src/assets/app/i18n/en-gb.json
sails/src/assets/app/i18n/es-es.json
sails/src/assets/scripts/modules/login/controllers/login.js
sails/src/assets/scripts/modules/login/views/login.html
sails/src/assets/app/i18n/en-gb.json
View file @
8367f4c3
...
...
@@ -121,6 +121,7 @@
"edit"
:
"Edit"
,
"email"
:
"Email address"
,
"email_confirm"
:
"E-mail address confirmation"
,
"email_invalid"
:
"Invalid email"
,
"email_match"
:
"The emails must match"
,
"email_type"
:
"E-mail address"
,
"enable_sound_for"
:
"Enable sound for"
,
...
...
sails/src/assets/app/i18n/es-es.json
View file @
8367f4c3
...
...
@@ -121,6 +121,7 @@
"edit"
:
"Editar"
,
"email"
:
"Correo electrónico"
,
"email_confirm"
:
"Repite tu email"
,
"email_invalid"
:
"El email no es válido"
,
"email_match"
:
"Los emails deben coincidir"
,
"email_type"
:
"Introduce tu email"
,
"enable_sound_for"
:
"Habilitar sonido para"
,
...
...
sails/src/assets/scripts/modules/login/controllers/login.js
View file @
8367f4c3
...
...
@@ -113,40 +113,56 @@ function LoginCtrl(
role
:
''
,
};
$scope
.
minlength
=
CONSTANTS
.
password_minlength
;
$scope
.
minlength
=
CONSTANTS
.
password_minlength
;
$scope
.
reset
=
function
()
{
$scope
.
formdata
=
formdata_empty
;
};
/* Forms objects */
$scope
.
forms
=
{};
$scope
.
reset
=
function
()
{
$scope
.
formdata
=
formdata_empty
;
};
$scope
.
reset
();
$scope
.
reset
();
// Signup form submit
$scope
.
signup
=
function
()
{
$scope
.
signup
=
function
(
formName
)
{
var
form
;
if
(
formName
==
'tutorForm'
)
form
=
$scope
.
forms
.
tutorForm
;
else
if
(
formName
==
'therapistForm'
)
form
=
$scope
.
forms
.
therapistForm
;
else
form
=
$scope
.
forms
.
officeForm
;
if
(
typeof
$scope
.
formdata
.
email
==
'undefined'
||
form
.
email
.
$invalid
)
{
ngToast
.
danger
(
$translate
.
instant
(
'email_invalid'
));
return
;
}
if
(
$scope
.
formdata
.
password
.
length
<
CONSTANTS
.
password_minlength
)
{
ngToast
.
danger
(
{
content
:
$translate
.
instant
(
'password_short'
,
{
minlength
:
CONSTANTS
.
password_minlength
})
}
);
ngToast
.
danger
(
$translate
.
instant
(
'password_short'
,
{
minlength
:
CONSTANTS
.
password_minlength
})
);
return
;
}
if
(
!
$scope
.
formdata
.
disclaimer_accepted
)
{
ngToast
.
danger
(
{
content
:
$translate
.
instant
(
'disclaimer_requested'
)
}
);
if
(
$scope
.
formdata
.
password
!==
$scope
.
formdata
.
password_confirm
)
{
ngToast
.
danger
(
$translate
.
instant
(
'password_match'
)
);
return
;
}
if
(
!
$scope
.
formdata
.
role
)
{
ngToast
.
danger
(
{
content
:
$translate
.
instant
(
'case_requested'
)
}
);
if
(
!
$scope
.
formdata
.
disclaimer_accepted
)
{
ngToast
.
danger
(
$translate
.
instant
(
'disclaimer_requested'
)
);
return
;
}
if
(
!
$scope
.
signInForm
.
$
valid
)
if
(
form
.
$in
valid
)
return
;
$http
.
post
(
config
.
backend
+
'/sup'
,
$scope
.
formdata
)
.
success
(
function
()
{
ngToast
.
success
({
content
:
$translate
.
instant
(
'user_created'
,
{
name
:
$scope
.
formdata
.
name
,
surname
:
$scope
.
formdata
.
surname
})
});
$scope
.
reset
();
$scope
.
slide
.
rightTo
(
'confirmation'
);
})
.
error
(
function
()
{
ngToast
.
danger
({
content
:
$translate
.
instant
(
'user_exists'
,
{
email
:
$scope
.
formdata
.
email
})
});
...
...
sails/src/assets/scripts/modules/login/views/login.html
View file @
8367f4c3
This diff is collapsed.
Click to expand it.
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