issue #303

parent 75e90742
...@@ -115,6 +115,10 @@ module.exports = { ...@@ -115,6 +115,10 @@ module.exports = {
student.license.isTrial = student.license.type == 'trial'; student.license.isTrial = student.license.type == 'trial';
student.license.isOfficial = student.license.type == 'official'; student.license.isOfficial = student.license.type == 'official';
} else student.license = null; } else student.license = null;
if (!student.name || student.name.length == 0)
student.name = sails.__({phrase: 'no_name', locale: student.lang});
if (!student.surname || student.surname.length == 0)
student.surname = sails.__({phrase: 'no_surname', locale: student.lang});
student.attributes = Student.getValidAttributes(student.attributes); student.attributes = Student.getValidAttributes(student.attributes);
student.current_method = student.lastInstruction[0] ? student.lastInstruction[0].met_name : "no_method"; 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"; student.current_instruction = student.lastInstruction[0] ? student.lastInstruction[0].ins_name : "no_instruction";
......
...@@ -130,6 +130,10 @@ module.exports = { ...@@ -130,6 +130,10 @@ module.exports = {
supervisor.isTherapist = supervisor.role == 'therapist'; supervisor.isTherapist = supervisor.role == 'therapist';
supervisor.isOffice = supervisor.role == 'office'; supervisor.isOffice = supervisor.role == 'office';
supervisor.isAdmin = supervisor.role == 'admin'; supervisor.isAdmin = supervisor.role == 'admin';
if (!supervisor.name || supervisor.name.length == 0)
supervisor.name = sails.__({phrase: 'no_name', locale: supervisor.lang});
if (!supervisor.surname || supervisor.surname.length == 0)
supervisor.surname = sails.__({phrase: 'no_surname', locale: supervisor.lang});
delete supervisor.password; delete supervisor.password;
return supervisor; return supervisor;
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
<i ng-show="!student.license.isValid && student.license.isTrial" class="fa fa-flask fa-lg text-danger license-warning" aria-hidden="true" popover="{{ 'license_missing_trial' | translate}}" popover-trigger="mouseenter"></i> <i ng-show="!student.license.isValid && student.license.isTrial" class="fa fa-flask fa-lg text-danger license-warning" aria-hidden="true" popover="{{ 'license_missing_trial' | translate}}" popover-trigger="mouseenter"></i>
</td> </td>
<td> <td>
<h4>{{student.surname}}, {{student.name}}</h4> <h4 class="student-list-name">{{ student.surname }}, {{ student.name }}</h4>
<span class="text-muted"> {{ student.username }} </span>
</td> </td>
<td> <td>
<p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p> <p> <span> {{student.current_method | translate}} </span> <br /> <span class="text-muted">{{student.current_instruction | translate}}</span> </p>
......
...@@ -872,7 +872,11 @@ img.profile{ ...@@ -872,7 +872,11 @@ img.profile{
} }
.license-warning{ .license-warning{
margin-top: 10px; margin-top: 20px;
}
.student-list-name {
margin-bottom: 0px;
} }
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
"Welcome": "Welcome", "Welcome": "Welcome",
"A brand new app.": "A brand new app.", "A brand new app.": "A brand new app.",
"notification_from_pictogram": "Notification from Pictogram", "notification_from_pictogram": "Notification from Pictogram",
"no_name": "No name",
"no_surname": "No surname",
"signin_mail": "To activate your Pictogram account, click on this link:\n", "signin_mail": "To activate your Pictogram account, click on this link:\n",
"change_password_mail": "To change your password, please click on the following link:\n", "change_password_mail": "To change your password, please click on the following link:\n",
"login": "login", "login": "login",
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
"Welcome": "Bienvenido", "Welcome": "Bienvenido",
"A brand new app.": "Una aplicación de la nueva marca.", "A brand new app.": "Una aplicación de la nueva marca.",
"notification_from_pictogram": "Notificación desde Pictogram", "notification_from_pictogram": "Notificación desde Pictogram",
"no_name": "Sin nombre",
"no_surname": "Sin apellidos",
"signin_mail": "Para activar su cuenta en Pictogram, haga click en el siguiente enlace:\n", "signin_mail": "Para activar su cuenta en Pictogram, haga click en el siguiente enlace:\n",
"change_password_mail": "Para cambiar su contraseña, haga click en el siguiente enlace:\n", "change_password_mail": "Para cambiar su contraseña, haga click en el siguiente enlace:\n",
"login": "acceder", "login": "acceder",
......
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