new supervisors signup (without specifying password) working

parent a0ec26c5
......@@ -308,7 +308,7 @@ module.exports = {
sails.log.debug("Creating supervisor with params " + JSON.stringify(params));
if (!params.name || !params.surname || !params.email )
if (!params.name || !params.email || params.role != 'office' && !params.surname)
return res.badRequest("Invalid params");
// randomly generated memorable password
......
......@@ -144,7 +144,7 @@ $scope.signup = function (formName) {
return;
}
if (typeof $scope.formdata.surname == 'undefined' || form.surname.$invalid) {
if ($scope.formdata.role != "office" && (typeof $scope.formdata.surname == 'undefined' || form.surname.$invalid )) {
ngToast.danger($translate.instant('surname_invalid'));
return;
}
......
......@@ -152,12 +152,11 @@
<img src="img/parents.png" alt="{{'parents_tutor' | translate}}" title="{{'parents_tutor' | translate}}" />
</div>
<div class="form-group col-md-4">
<input type="hidden" ng-model="formdata.role" value="tutor"></input>
<label translate>name</label>
<div class="form-group">
<label translate>name</label>
<div class="form-group">
<input type="text" class="form-control" name="name" placeholder="{{ 'name' | translate }}" ng-model="formdata.name" required/>
</div>
<input type="text" class="form-control" name="name" placeholder="{{ 'name' | translate }}" ng-model="formdata.name" required/>
</div>
<label translate>surname</label>
<div class="form-group">
......@@ -205,26 +204,26 @@
<img src="img/therapist.png" alt="{{'therapist' | translate}}" title="{{'therapist' | translate}}" />
</div>
<div class="form-group col-md-4" id="tutor_form">
<input type="hidden" ng-model="formdata.role" value="therapist"></input>
<label translate>name</label>
<div class="form-group">
<input type="text" class="form-control" name="name" placeholder="{{ 'name' | translate }}" ng-model="formdata.name" required/>
</div>
<label translate>surname</label>
<div class="form-group">
<input type="text" class="form-control" name="surname" placeholder="{{ 'surname' | translate }}" ng-model="formdata.surname" required/>
</div>
<label translate>email</label>
<div class="form-group">
<label translate>email</label>
<input type="email" class="form-control" name="email" placeholder="{{ 'email' | translate }}" ng-model="formdata.email"/>
<span class="color_red text_sm pull-right" ng-show="forms.therapistForm.email.$dirty && forms.therapistForm.email.$invalid" translate>email_invalid</span>
<span class="color_red text_sm pull-right" ng-show="forms.theraphistForm.email.$dirty && forms.theraphistForm.email.$invalid" translate>email_invalid</span>
</div>
<fieldset>
<label translate>password</label>
<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.therapistForm.password.$dirty && forms.therapistForm.password_confirm.$dirty"> {{ 'password_short' | translate:'{ minlength: minlength }' }}</span>
</div>
<div class="form-group">
<input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" name="password_confirm" required ng-model="formdata.password_confirm"/>
<span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm && forms.therapistForm.password.$dirty && forms.therapistForm.password_confirm.$dirty" translate>password_match</span>
</div>
</fieldset>
<div class="form-group">
<input type="checkbox" ng-model="formdata.disclaimer_accepted">
<span translate>disclaimer_accept</span>
</div>
<div class="form-group">
<label>Captcha</label>
<div vc-recaptcha></div>
......@@ -256,26 +255,16 @@
<img src="img/office.jpg" alt="{{'office_center' | translate}}" title="{{'office_center' | translate}}" />
</div>
<div class="form-group col-md-4" id="office_form">
<input type="hidden" ng-model="formdata.role" value="office"></input>
<label translate>name</label>
<div class="form-group">
<label translate>name</label>
<input type="text" class="form-control" placeholder="{{ 'name' | translate }}" name="name" required ng-model="formdata.name"/>
<input type="text" class="form-control" name="name" placeholder="{{ 'name' | translate }}" ng-model="formdata.name" required/>
</div>
<div class="form-group">
<label translate>email</label>
<input type="email" class="form-control" placeholder="{{ 'email' | translate }}" name="email" required ng-model="formdata.email"/>
<span class="color_red text_sm pull-right" ng-show="forms.officeForm.email.$dirty && forms.officeForm.email.$invalid" translate>email_invalid</span>
</div>
<fieldset>
<label translate>password</label>
<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>
</div>
<div class="form-group">
<input type="password" class="form-control" id="signin_password2" placeholder="{{ 'password_confirm' | translate }}" name="password_confirm" required ng-model="formdata.password_confirm"/>
<span class="color_red text_sm pull-right" ng-show="formdata.password != formdata.password_confirm && forms.officeForm.password.$dirty && forms.officeForm.password_confirm.$dirty" translate>password_match</span>
</div>
</fieldset>
<div class="form-group">
<input type="checkbox" ng-model="formdata.disclaimer_accepted">
<span translate>disclaimer_accept</span>
......
......@@ -5,12 +5,12 @@
"notification_from_pictogram": "Notification from Pictogram",
"no_name": "No name",
"no_surname": "No surname",
"office_link": "The office/center \"{{ name }}\" with email \"{{ email }}\" has added you as part of its team in Pictogram.",
"signin_mail": "To activate your Pictogram account, first click on this link:\n {{ url }} \nAccess with your email and the following password:\n {{ password }}\nWe recommend to change your password as soon as possible.",
"student_unlinked": "You have lost the link to the student \"{{ name }} {{ surname }}\", with license number \"{{ license }}\".",
"therapist_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as therapist to any of your students.",
"tutor_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as tutor/father/mother to any of your students.",
"office_link": "The office/center \"{{{ name }}}\" with email \"{{{ email }}}\" has added you as part of its team in Pictogram.",
"signin_mail": "To activate your Pictogram account, first click on this link:\n {{{ url }}} \nAccess with your email and the following password:\n {{{ password }}}\nWe recommend to change your password as soon as possible.",
"student_unlinked": "You have lost the link to the student \"{{{ name }}} {{{ surname }}}\", with license number \"{{{ license }}}\".",
"therapist_office_request": "{{{ name }}, with email {{{ email }}} is requesting to be linked as therapist to any of your students.",
"tutor_office_request": "{{{ name }}}, with email {{{ email }}}, is requesting to be linked as tutor/father/mother to any of your students.",
"Welcome": "Welcome",
"welcome_msg1": "Welcome to Pictogram, {{ name }}!",
"welcome_msg1": "Welcome to Pictogram, {{{ name }}}!",
"welcome_msg2": "Your account is now active. You can proceed to"
}
......@@ -5,12 +5,12 @@
"notification_from_pictogram": "Notificación desde Pictogram",
"no_name": "Sin nombre",
"no_surname": "Sin apellidos",
"office_link": "El centro/gabinete \"{{ name }}\", con correo electrónico \"{{ email }}\" le ha añadido como parte de su equipo.",
"signin_mail": "Para activar su cuenta en Pictogram, primero haga click en el siguiente enlace:\n {{ url }} \nAcceda con su correo y la contraseña siguiente:\n {{ password }}\nLe recomendamos modificar la contraseña tan pronto accede al sistema.",
"student_unlinked": "Se ha desvinculado de la cuenta de estudiante \"{{ name }} {{ surname }}\", con número de licencia \"{{ license }}\".",
"therapist_office_request": "El/la terapeuta {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante.",
"tutor_office_request": "El/la tutor/a/padre/madre {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante.",
"office_link": "El centro/gabinete \"{{{ name }}}\", con correo electrónico \"{{{ email }}}\" le ha añadido como parte de su equipo.",
"signin_mail": "Para activar su cuenta en Pictogram, primero haga click en el siguiente enlace:\n {{{ url }}} \nAcceda con su correo y la contraseña siguiente:\n {{{ password }}}\nLe recomendamos modificar la contraseña tan pronto accede al sistema.",
"student_unlinked": "Se ha desvinculado de la cuenta de estudiante \"{{{ name }}} {{{ surname }}}\", con número de licencia \"{{{ license }}}\".",
"therapist_office_request": "El/la terapeuta {{{ name }}}, con correo electrónico {{{ email }}}, pide ser asociado a algún estudiante.",
"tutor_office_request": "El/la tutor/a/padre/madre {{{ name }}}, con correo electrónico {{{ email }}}, pide ser asociado a algún estudiante.",
"Welcome": "Bienvenido",
"welcome_msg1": "¡Bienvenido a Pictogram, {{ name }}!",
"welcome_msg1": "¡Bienvenido a Pictogram, {{{ name }}}!",
"welcome_msg2": "Su cuenta está ahora activa, por lo que puede"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment