Supervisors management by offices ready

parent af191494
...@@ -17,12 +17,17 @@ ALTER TABLE student MODIFY lang VARCHAR(5) DEFAULT NULL; ...@@ -17,12 +17,17 @@ ALTER TABLE student MODIFY lang VARCHAR(5) DEFAULT NULL;
ALTER TABLE license ADD type enum('trial', 'official') NOT NULL DEFAULT 'official'; ALTER TABLE license ADD type enum('trial', 'official') NOT NULL DEFAULT 'official';
CREATE TABLE IF NOT EXISTS sup_off ( CREATE TABLE `sup_off` (
id_sup int(11) NOT NULL,ALTER TABLE license ADD type enum('trial', 'official') NOT NULL DEFAULT 'official'; `id` int(11) NOT NULL AUTO_INCREMENT,
id_off int(11) DEFAULT NULL, `id_sup` int(11) NOT NULL,
CONSTRAINT fk_sup_off FOREIGN KEY (id_sup) REFERENCES supervisor (id), `id_off` int(11) DEFAULT NULL,
CONSTRAINT fk_off_sup FOREIGN KEY (id_off) REFERENCES supervisor (id) KEY `fk_sup_off` (`id_sup`),
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; KEY `fk_off_sup` (`id_off`),
PRIMARY KEY(`id`),
UNIQUE KEY `idx_sup_off` (`id_sup`,`id_off`),
CONSTRAINT `fk_off_sup` FOREIGN KEY (`id_off`) REFERENCES `supervisor` (`id`),
CONSTRAINT `fk_sup_off` FOREIGN KEY (`id_sup`) REFERENCES `supervisor` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
UPDATE supervisor UPDATE supervisor
SET role = 'office' SET role = 'office'
......
...@@ -441,6 +441,130 @@ module.exports = { ...@@ -441,6 +441,130 @@ module.exports = {
}, },
/** /**
* Get all supervisors in the database that are linked to the user as office.
* @param {request} req //
* {
id {ID} ID of the office (as a GET parameter)
}
* @param {response} res
* [
* {
* "id": 123,
* "name": "John"
* "surname": "Doe"
* "gender": "F/M"
* "password": "1234"
* "pic": "url/to/photo.jpg" (optional)
* "address": "Nice street" (optional)
* "country": "ES/UK/..." (optional)
* "email": "john@doe.com" (optional)
* "phone": "+123456789" (optional)
* "lang": "ES/EN/..." (optional)
* "tts_engine": "IVONA Text-to-Speech HQ" (optional)
* },
* ...
* ]
*/
supervisors: function (req, res) {
if (!req.params.id)
return res.badRequest("Supervisor ID missing");
var enriched_sups = [];
SupOff.find({office: req.params.id})
.populate('supervisor')
.then(function (supOffs) {
var sups = supOffs.map(so => so.supervisor);
async.eachSeries(sups, function (sup, next) {
if (!sup) return next();
Supervisor.commonStudents(sup.id, req.params.id, function (err, stus) {
if (err)
return next(err);
sup = sup.toJSON();
if (!stus || stus.length == 0)
sup.students = [];
else
sup.students = stus;
enriched_sups.push(sup);
next();
});
},
function (err) {
if (err) throw err;
else res.ok(enriched_sups);
});
})
.catch(function (err) {
res.serverError(err);
});
},
/**
* Links a new supervisor to the office
*
*/
link_supervisor: function (req, res) {
if (!req.params.id_off || !req.params.id_sup)
return res.badRequest();
if (req.params.id_off == req.params.id_sup)
return res.badRequest("Link to yourself is not allowed");
// Check that both ids are valid
Supervisor.findOne(req.params.id_sup)
.then((s) => {
if (!s)
throw new Error("Supervisor not found");
return Supervisor.findOne(req.params.id_off);
}).then((s) => {
if (!s)
throw new Error("Supervisor not found");
return SupOff.create({supervisor: req.params.id_sup, office: req.params.id_off});
})
.then((so) => {
if (!so)
throw new Error("Unable to perform linking");
res.ok();
})
.catch((err) => {
res.badRequest(err.message);
});
},
/**
* Unlinks a supervisor from an office
*
*/
unlink_supervisor: function (req, res) {
if (!req.params.id_off || !req.params.id_sup)
return res.badRequest();
// Check that both ids are valid
Supervisor.findOne(req.params.id_sup)
.then((s) => {
if (!s)
throw new Error("Supervisor not found");
return Supervisor.findOne(req.params.id_off);
})
.then((s) => {
if (!s)
throw new Error("Supervisor not found");
return SupOff.destroy({supervisor: req.params.id_sup, office: req.params.id_off});
})
.then((sos) => {
if (!sos)
throw new Error("No link exists");
res.ok();
})
.catch((err) => {
res.badRequest(err.message);
});
},
/**
* Get the list of students linked to this supervisor. * Get the list of students linked to this supervisor.
* The extra supervision attribute indicates the existing relationship between the supervisor and * The extra supervision attribute indicates the existing relationship between the supervisor and
* the student: * the student:
...@@ -486,6 +610,19 @@ module.exports = { ...@@ -486,6 +610,19 @@ module.exports = {
}); });
}, },
/*
Returns all the common students associated to both supervisors
*/
commonStudents: function (req, res) {
if (!req.params.id_sup || !req.params.id_off)
return res.badRequest();
Supervisor.commonStudents(req.params.id_sup, req.params.id_off, function (err, stus) {
if (err) throw err;
return res.ok(stus);
});
},
/** /**
* Get the pictos owned by this supervisor * Get the pictos owned by this supervisor
* @param {request} req {} * @param {request} req {}
......
/**
* office.js
*
* @description :: TODO: Write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
connection : 'localMysql',
tableName : 'office',
migrate : 'safe',
schema : true,
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
autoIncrement: true,
primaryKey: true,
unique: true
},
name: {
required: true,
type: "string",
size: 80
},
logoUrl: {
columnName: 'logo_url',
type: "string",
size: 240
},
address: {
required: true,
type: "string",
size: 80
},
country: {
type: "string",
size: 5,
required: true
},
lang: {
required: true,
type: "string",
size: 5
},
contactPerson: {
columnName: "contact_person",
required: true,
type: "string",
size: 80
},
email: {
required: true,
type: "string",
size: 80,
unique: true
},
phone1: {
required: true,
type: "string",
size: 20
},
phone2: {
type: "string",
size: 20
},
admin: {
columnName: 'admin',
type: 'integer',
model: 'Supervisor'
},
postalCode: {
columnName: 'postal_code',
required: true,
type: "string",
size: 10
},
toJSON: function() {
var office = this.toObject();
if (!office.logoUrl)
office.logoUrl = '/app/img/logo_pictogram.png';
return office;
}
},
beforeCreate: function (attrs, next) {
if (!attrs.logoUrl)
attrs.logoUrl = '/app/img/logo_pictogram.png';
next();
}
};
/**
* StuSup.js
*
* @description :: TODO: Write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
/**
* This model relates tutors and therapists with offices
*/
module.exports = {
tableName : 'sup_off',
migrate : 'safe',
schema : true,
autoPK : false,
autoCreatedAt : false,
autoUpdatedAt : false,
attributes: {
id: {
type: "integer",
autoIncrement: true,
primaryKey: true,
unique: true
},
supervisor: { // FK de Supervisor. 1 a N
columnName: "id_sup",
required: true,
type: "integer",
model: "Supervisor"
},
office: { // FK de Supervisor. 1 a N
columnName: "id_off",
type: "integer",
model: "Supervisor"
}
}
}
...@@ -253,11 +253,6 @@ module.exports = { ...@@ -253,11 +253,6 @@ module.exports = {
s.current_instruction = s.lastInstruction[0] ? s.lastInstruction[0].ins_name : "no_instruction"; s.current_instruction = s.lastInstruction[0] ? s.lastInstruction[0].ins_name : "no_instruction";
if (!s.license) if (!s.license)
return next_cb(); return next_cb();
//
// El alumno tiene licencia, es válida y no es de prueba
//
if (s.license.isValid || s.license.isOfficial)
l.push(s); l.push(s);
next_cb(); next_cb();
}); });
...@@ -269,5 +264,52 @@ module.exports = { ...@@ -269,5 +264,52 @@ module.exports = {
.catch((err) => { .catch((err) => {
callback(err, l); callback(err, l);
}); // end Supervisor.findOne }); // end Supervisor.findOne
},
/***
* Return the list of students that are common to both supervisors
*/
commonStudents: function(id1, id2, callback) {
var l = [];
StuSup.find({ supervisor: id1 })
.then(function (stuSups) {
return [stuSups, StuSup.find({ supervisor: id2 })];
})
.spread((stuSups1, stuSups2) => {
if (!stuSups1 || !stuSups2)
throw new Error("No students");
// Common students
var stuSups = stuSups1.filter(a => stuSups2.findIndex(b => b.student == a.student) >= 0);
// Now, let's take full information about them
async.eachSeries(stuSups, function(stuSup, next_cb) {
// set current method and instruction if any
Student.findOne(stuSup.student)
.populate('lastInstruction')
.populate('license')
.then(function (s) {
if (!s)
return next_cb();
s = s.toJSON();
s.current_method = s.lastInstruction[0] ? s.lastInstruction[0].met_name : "no_method";
s.current_instruction = s.lastInstruction[0] ? s.lastInstruction[0].ins_name : "no_instruction";
if (!s.license)
return next_cb();
l.push(s);
next_cb();
});
},
function (err) {
return callback(err, l);
});
})
.catch((err) => {
return callback(err, l);
});
} }
}; };
...@@ -205,12 +205,13 @@ ...@@ -205,12 +205,13 @@
"license_created": "License created", "license_created": "License created",
"license_expired_official": "PRO license expired. To maintain access to therapeutical functionalities you can", "license_expired_official": "PRO license expired. To maintain access to therapeutical functionalities you can",
"license_expired_trial": "Trial license expired. To keep the account you should", "license_expired_trial": "Trial license expired. To keep the account you should",
"license_expired_buy": "buy one", "license_expired_buy": "buy one license",
"license_expired_renew": "renew it", "license_expired_renew": "renew it",
"license_expires_official": "PRO license expires on ", "license_expires_official": "PRO license expires on ",
"license_expires_trial": "Trial license expires on ", "license_expires_trial": "Trial license expires on ",
"license_invalid": "Invalid license number", "license_invalid": "Invalid license number",
"license_missing": "Account without PRO license", "license_missing_official": "This PRO license expired. You have no access to therapeutical functionalities, but you can still manage pictograms and devices.",
"license_missing_trial": "Trial license expired. Buy an official one to keep using this account (go to Settings).",
"license_number": "License number", "license_number": "License number",
"license_pro": "Pictogram PRO license", "license_pro": "Pictogram PRO license",
"license_warning": "Only available for professional licenses (Pictogram Pro).", "license_warning": "Only available for professional licenses (Pictogram Pro).",
...@@ -218,6 +219,8 @@ ...@@ -218,6 +219,8 @@
"licenses_left": "{{number}} licenses left", "licenses_left": "{{number}} licenses left",
"light_up": "Light up", "light_up": "Light up",
"link": "Link", "link": "Link",
"link_supervisor": "Link supervisor",
"link_supervisor_desc": "When linking a therapist/parent/tutor, he/she will be notified of this action.",
"loading_pictos": "Loading pictos", "loading_pictos": "Loading pictos",
"login": "Log In", "login": "Log In",
"login_fail": "Invalid user or password", "login_fail": "Invalid user or password",
...@@ -258,12 +261,15 @@ ...@@ -258,12 +261,15 @@
"no": "No", "no": "No",
"no_categories": "Without categories", "no_categories": "Without categories",
"nobegin": "No started", "nobegin": "No started",
"no_instruction": "No instruction defined",
"no_method": "No method defined", "no_method": "No method defined",
"no_office": "No office", "no_office": "No office",
"no_subscribed": "No connection to student account", "no_subscribed": "No connection to student account",
"no_instruction": "No instruction defined",
"no_students_for_user": "You are not associated to any students. Please ask your office to link your account to a Pictogram student.", "no_students_for_user": "You are not associated to any students. Please ask your office to link your account to a Pictogram student.",
"no_space_in_category": "No space left in category", "no_space_in_category": "No space left in category",
"no_supervisors": "No supervisors linked. ",
"no_supervisors_desc": "Enter supervisor's email in the input field above to add one.",
"no_supervisor_linked": "Unable to link supervisor",
"normal": "Normal", "normal": "Normal",
"note": "Note", "note": "Note",
"notes": "Notes", "notes": "Notes",
...@@ -414,12 +420,14 @@ ...@@ -414,12 +420,14 @@
"sup_not_deleted": "The supervisor couldn't be deleted by the student", "sup_not_deleted": "The supervisor couldn't be deleted by the student",
"sup_not_found": "There is no supervisor account in Pictogram with this email", "sup_not_found": "There is no supervisor account in Pictogram with this email",
"supervisor_added": "Supervisor added", "supervisor_added": "Supervisor added",
"supervisor_already_linked": "The supervisor is already linked to your account",
"supervisor_deleted": "Supervisor deleted", "supervisor_deleted": "Supervisor deleted",
"supervisor_not_added": "Supervisor not added", "supervisor_not_added": "Supervisor not added",
"supervisor_not_deleted": "Supervisor not deleted", "supervisor_not_deleted": "Supervisor not deleted",
"supervisor_not_updated": "Supervisor not updated", "supervisor_not_updated": "Supervisor not updated",
"supervisor_note": "If the parent aren't going to register in the platform, the administrator can use the notes field to store their information.", "supervisor_note": "If the parent aren't going to register in the platform, the administrator can use the notes field to store their information.",
"supervisor_updated": "Supervisor updated", "supervisor_updated": "Supervisor updated",
"supervisor_yourself": "This is you. No reason to link to yourself.",
"supervisors": "Supervisors", "supervisors": "Supervisors",
"support": "User support", "support": "User support",
"surname": "Surname", "surname": "Surname",
......
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
"license_created": "Licencia creada", "license_created": "Licencia creada",
"license_expired_official": "La licencia PRO expiró. Para mantener acceso a funcionalidades terapéuticas puede", "license_expired_official": "La licencia PRO expiró. Para mantener acceso a funcionalidades terapéuticas puede",
"license_expired_trial": "La licencia de prueba expiró. Para mantener la cuenta debería", "license_expired_trial": "La licencia de prueba expiró. Para mantener la cuenta debería",
"license_expired_buy": "adquirir una", "license_expired_buy": "adquirir una licencia",
"license_expired_renew": "renovarla", "license_expired_renew": "renovarla",
"license_expires_official": "La licencia PRO finaliza el ", "license_expires_official": "La licencia PRO finaliza el ",
"license_expires_trial": "La licencia de prueba finaliza el ", "license_expires_trial": "La licencia de prueba finaliza el ",
...@@ -214,10 +214,13 @@ ...@@ -214,10 +214,13 @@
"license_number": "Número de licencia", "license_number": "Número de licencia",
"license_pro": "Licencia Pictogram PRO", "license_pro": "Licencia Pictogram PRO",
"license_warning": "Sólo disponible para licencias profesionales (Pictogram Pro).", "license_warning": "Sólo disponible para licencias profesionales (Pictogram Pro).",
"license_missing": "Cuenta sin licencia PRO", "license_missing_official": "La licencia PRO expiró. El acceso a las funcionalidades terapéuticas queda restringido, aunque puede seguir gestionando pictogramas y dispositivos.",
"license_missing_trial": "La licencia de prueba expiró. Adquiera una licencia oficial para mantener esta cuenta (puede hacerlo en Configuración).",
"licenses_created": "Licencias creadas", "licenses_created": "Licencias creadas",
"light_up": "Iluminar", "light_up": "Iluminar",
"link": "Vincular", "link": "Vincular",
"link_supervisor": "Vincular supervisor",
"link_supervisor_desc": "Al vincular un terapeuta/padre/madre/tutor se enviará un correo de notificación al mismo.",
"loading_pictos": "Cargando pictos", "loading_pictos": "Cargando pictos",
"login": "Iniciar sesión", "login": "Iniciar sesión",
"login_fail": "Usuario o contraseña incorrectos", "login_fail": "Usuario o contraseña incorrectos",
...@@ -263,6 +266,9 @@ ...@@ -263,6 +266,9 @@
"no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacte con su gabinete para enlazar su cuenta a un estudiante.", "no_students_for_user": "Su cuenta no está asociada a ningún estudiante. Por favor, contacte con su gabinete para enlazar su cuenta a un estudiante.",
"no_space_in_category": "No queda espacio en la categoría", "no_space_in_category": "No queda espacio en la categoría",
"no_subscribed": "Sin conexión a la cuenta del estudiante", "no_subscribed": "Sin conexión a la cuenta del estudiante",
"no_supervisors": "No tiene tutores, padres o terapeutas asociados.",
"no_supervisors_desc": "Introduzca el correo electrónico del supervisor en el campo de arriba para añadirlo.",
"no_supervisor_linked": "No se pudo asociar al supervisor",
"nobegin": "Sin iniciar", "nobegin": "Sin iniciar",
"normal": "Normal", "normal": "Normal",
"note": "Nota", "note": "Nota",
...@@ -275,7 +281,7 @@ ...@@ -275,7 +281,7 @@
"num_sessions_per_month_in": "Número de sesiones por meses en", "num_sessions_per_month_in": "Número de sesiones por meses en",
"objetive": "Objetivo", "objetive": "Objetivo",
"October": "Octubre", "October": "Octubre",
"office": "Gabinete", "office": "Gabinete/centro",
"office_account_desc": "Gestione alumnos y equipos de intervención, además de todas las funcionalidades propias de un terapeuta.", "office_account_desc": "Gestione alumnos y equipos de intervención, además de todas las funcionalidades propias de un terapeuta.",
"office_center": "Gabinete/centro", "office_center": "Gabinete/centro",
"office_added": "Gabinete añadido", "office_added": "Gabinete añadido",
...@@ -414,12 +420,14 @@ ...@@ -414,12 +420,14 @@
"sup_not_deleted": "El supervisor no se ha podido desvincular del alumno.", "sup_not_deleted": "El supervisor no se ha podido desvincular del alumno.",
"sup_not_found": "No hay ningún usuario en Pictogram con ese correo electrónico.", "sup_not_found": "No hay ningún usuario en Pictogram con ese correo electrónico.",
"supervisor_added": "Supervisor añadido", "supervisor_added": "Supervisor añadido",
"supervisor_already_linked": "El supervisor ya está vinculado",
"supervisor_deleted": "Supervisor eliminado", "supervisor_deleted": "Supervisor eliminado",
"supervisor_not_added": "Supervisor no añadido", "supervisor_not_added": "Supervisor no añadido",
"supervisor_not_deleted": "No se ha podido eliminar el supervisor", "supervisor_not_deleted": "No se ha podido eliminar el supervisor",
"supervisor_not_updated": "El supervisor no se ha podido actualizar", "supervisor_not_updated": "El supervisor no se ha podido actualizar",
"supervisor_note": "Si los padres no se van a dar de alta en la plataforma nunca, el administrador puede anotar la información de contacto en el campo notas.", "supervisor_note": "Si los padres no se van a dar de alta en la plataforma nunca, el administrador puede anotar la información de contacto en el campo notas.",
"supervisor_updated": "Supervisor actualizado", "supervisor_updated": "Supervisor actualizado",
"supervisor_yourself": "Este es usted. No hay razón para añadir a uno mismo.",
"support": "Atención al cliente", "support": "Atención al cliente",
"supervisors": "Supervisores", "supervisors": "Supervisores",
"surname": "Apellidos", "surname": "Apellidos",
......

25.4 KB | W: | H:

25.2 KB | W: | H:

sails/src/assets/app/img/parents.png
sails/src/assets/app/img/parents.png
sails/src/assets/app/img/parents.png
sails/src/assets/app/img/parents.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('tutor'); formdata.role = 'tutor'"> <a ng-click="slide.rightTo('tutor'); formdata.role = 'tutor'">
<img src="img/parents.png" alt="{{'parents_tutor' | translate}}" title="{{'parents_tutor' | translate}}" <img src="img/parents.png" alt="{{'parents_tutor' | translate}}" title="{{'parents_tutor' | translate}}"
ng-class="{'small-img': hover_tutor}" ng-class="{'img-200': hover_tutor}"
ng-mouseenter="hover_tutor = true" ng-mouseenter="hover_tutor = true"
ng-mouseleave="hover_tutor = false"/> ng-mouseleave="hover_tutor = false"/>
</a> </a>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('therapist'); formdata.role = 'therapist'"> <a ng-click="slide.rightTo('therapist'); formdata.role = 'therapist'">
<img src="img/therapist.png" alt="{{'therapist' | translate}}" title="{{'therapist' | translate}}" <img src="img/therapist.png" alt="{{'therapist' | translate}}" title="{{'therapist' | translate}}"
ng-class="{'small-img': hover_therapist}" ng-class="{'img-200': hover_therapist}"
ng-mouseenter="hover_therapist = true" ng-mouseenter="hover_therapist = true"
ng-mouseleave="hover_therapist = false"/> ng-mouseleave="hover_therapist = false"/>
</a> </a>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('office'); formdata.role = 'office'"> <a ng-click="slide.rightTo('office'); formdata.role = 'office'">
<img src="img/office.jpg" alt="{{'office_center' | translate}}" title="{{'office_center' | translate}}" <img src="img/office.jpg" alt="{{'office_center' | translate}}" title="{{'office_center' | translate}}"
ng-class="{'small-img': hover_office}" ng-class="{'img-200': hover_office}"
ng-mouseenter="hover_office = true" ng-mouseenter="hover_office = true"
ng-mouseleave="hover_office = false"/> ng-mouseleave="hover_office = false"/>
</a> </a>
......
...@@ -51,16 +51,16 @@ ...@@ -51,16 +51,16 @@
<div class="col-md-12"> <div class="col-md-12">
<ul class="nav nav-tabs tabs_student"> <ul class="nav nav-tabs tabs_student">
<!-- 0: admin, 1: tutor, 2: therapist --> <!-- 0: admin, 1: tutor, 2: therapist -->
<li role="presentation" ng-class="{'active' : nav.tab == 'collections'}" ng-if="studentData.supervision != 0"> <li role="presentation" ng-class="{'active' : nav.tab == 'collections'}" ng-if="studentData.license.isValid && !studentData.license.isTrial">
<a href="/app/#/student/{{studentData.id}}/collections" ng-click="nav.tab = ''"><span class="glyphicon glyphicon-th" aria-hidden="true"></span> {{ 'collections' | translate }}</a> <a href="/app/#/student/{{studentData.id}}/collections" ng-click="nav.tab = ''"><span class="glyphicon glyphicon-th" aria-hidden="true"></span> {{ 'collections' | translate }}</a>
</li> </li>
<li role="presentation" ng-class="{'active' : nav.tab == 'instructions'}" ng-if="studentData.supervision == 2"> <li role="presentation" ng-class="{'active' : nav.tab == 'instructions'}" ng-if="studentData.license.isValid && !user.isTutor">
<a href="/app/#/student/{{studentData.id}}/instructions" ng-click="nav.tab = 'instructions'"><span class="glyphicon glyphicon-tasks" aria-hidden="true"></span> {{ 'instructions' | translate }}</a> <a href="/app/#/student/{{studentData.id}}/instructions" ng-click="nav.tab = 'instructions'"><span class="glyphicon glyphicon-tasks" aria-hidden="true"></span> {{ 'instructions' | translate }}</a>
</li> </li>
<li role="presentation" ng-class="{'active' : nav.tab == 'session'}" ng-if="studentData.supervision == 2"> <li role="presentation" ng-class="{'active' : nav.tab == 'session'}" ng-if="studentData.license.isValid && !user.isTutor">
<a href="/app/#/student/{{studentData.id}}/session" ng-click="nav.tab = 'session'"><span class="glyphicon glyphicon-transfer" aria-hidden="true"></span> {{ 'sessions' | translate }}</a> <a href="/app/#/student/{{studentData.id}}/session" ng-click="nav.tab = 'session'"><span class="glyphicon glyphicon-transfer" aria-hidden="true"></span> {{ 'sessions' | translate }}</a>
</li> </li>
<li role="presentation" ng-class="{'active' : nav.tab == 'reports'}" ng-if="studentData.supervision != 1"> <li role="presentation" ng-class="{'active' : nav.tab == 'reports'}" ng-if="studentData.license.isValid && !user.isTutor">
<a href="/app/#/student/{{studentData.id}}/reports" ng-click="nav.tab = 'reports'"><i class="fa fa-bar-chart" aria-hidden="true"></i> {{ 'reports' | translate }}</a> <a href="/app/#/student/{{studentData.id}}/reports" ng-click="nav.tab = 'reports'"><i class="fa fa-bar-chart" aria-hidden="true"></i> {{ 'reports' | translate }}</a>
</li> </li>
<li role="presentation" ng-class="{'active' : nav.tab == 'setup'}"> <li role="presentation" ng-class="{'active' : nav.tab == 'setup'}">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<button class="btn btn-default" btn-radio="'account'" ng-model="section"> <button class="btn btn-default" btn-radio="'account'" ng-model="section">
<i class="fa fa-user" aria-hidden="true"></i> {{ 'account' | translate }} <i class="fa fa-user" aria-hidden="true"></i> {{ 'account' | translate }}
</button> </button>
<button class="btn btn-default" btn-radio="'device'" ng-model="section"> <button class="btn btn-default" btn-radio="'device'" ng-model="section" ng-if="studentData.license.isValid || studentData.license.isOfficial">
<i class="fa fa-tablet" aria-hidden="true"></i> {{ 'device' | translate }} <i class="fa fa-tablet" aria-hidden="true"></i> {{ 'device' | translate }}
</button> </button>
<button class="btn btn-default" btn-radio="'supervisors'" ng-model="section" ng-if="user.isOffice"> <button class="btn btn-default" btn-radio="'supervisors'" ng-model="section" ng-if="user.isOffice">
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<div class="row"> <div class="row">
<div class="col-xs-2"><i class="fa fa-certificate fa-lg text-danger" aria-hidden="true"></i></div> <div class="col-xs-2"><i class="fa fa-certificate fa-lg text-danger" aria-hidden="true"></i></div>
<div class="col-xs-10"> <div class="col-xs-10">
{{ 'license_expired_official' | translate }} <a href="http://pictogramweb.com/caracteristicas-de-pictogram/">{{ 'license_expired_renew' | translate }}</a> {{ 'license_expired_official' | translate }} <a href="http://pictogramweb.com/caracteristicas-de-pictogram/">{{ 'license_expired_renew' | translate }}</a>.
</div> </div>
</div> </div>
</div> </div>
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<div class="row"> <div class="row">
<div class="col-xs-2"><i class="fa fa-flask fa-lg text-danger" aria-hidden="true"></i></div> <div class="col-xs-2"><i class="fa fa-flask fa-lg text-danger" aria-hidden="true"></i></div>
<div class="col-xs-10"> <div class="col-xs-10">
{{ 'license_expired_trial' | translate }} <a href="http://pictogramweb.com/caracteristicas-de-pictogram/">{{ 'license_expired_buy' | translate }}</a> {{ 'license_expired_trial' | translate }} <a href="http://pictogramweb.com/caracteristicas-de-pictogram/">{{ 'license_expired_buy' | translate }}</a>.
</div> </div>
</div> </div>
</div> </div>
......
...@@ -27,23 +27,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl( ...@@ -27,23 +27,6 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
$scope.minlength = CONSTANTS.password_minlength; $scope.minlength = CONSTANTS.password_minlength;
var formdata_empty = {
username: '',
password: '',
password_confirm: '',
name: $translate.instant('name'),
surname: $translate.instant('surname'),
birthdate: Date(),
country: 'ES',
gender: 'M',
lang: 'es-es',
notes: '',
current_method: 'no_method',
current_instruction: 'no_instruction',
license_number: null,
id_sup: $scope.user.id
};
// Hide new student form // Hide new student form
$scope.hidestudentadd = true; $scope.hidestudentadd = true;
...@@ -83,7 +66,22 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl( ...@@ -83,7 +66,22 @@ dashboardControllers.controller('StudentsCtrl', function StudentsCtrl(
// Show student form // Show student form
$scope.showForm = function () { $scope.showForm = function () {
// Reset the form // Reset the form
$scope.formdata = formdata_empty; $scope.formdata = {
username: '',
password: '',
password_confirm: '',
name: $translate.instant('name'),
surname: $translate.instant('surname'),
birthdate: Date(),
country: 'ES',
gender: 'M',
lang: 'es-es',
notes: '',
current_method: 'no_method',
current_instruction: 'no_instruction',
license_number: null,
id_sup: $scope.user.id
};
$scope.slide.state ='accounts'; $scope.slide.state ='accounts';
$scope.slide.show = true; $scope.slide.show = true;
......
...@@ -5,16 +5,105 @@ ...@@ -5,16 +5,105 @@
//-------------------------- //--------------------------
dashboardControllers.controller('SupervisorsCtrl', function SupervisorsCtrl($scope, $window, $http, config, $translate, ngToast) { dashboardControllers.controller('SupervisorsCtrl', function SupervisorsCtrl($scope, $window, $http, config, $translate, ngToast) {
$scope.inputs = {
search_str: '',
email: ''
};
$scope.supToAdd = {};
function loadSupervisors() {
$http $http
.get(config.backend+'/office/get/' + $scope.user.office.id + '/supervisors') .get(config.backend+'/sup/' + $scope.user.id + '/supervisors')
.success(function(data, status, headers, config) { .success(function(data, status, headers, config) {
$scope.supervisors_list = data; $scope.supervisors_list = data;
console.log($scope.supervisors_list); console.log($scope.supervisors_list);
}) })
.error(function(data, status, headers, config) { .error(function(data, status, headers, config) {
$translate('error_downloading_supervisors').then(function (translation) { ngToast.danger($translate.instant('error_downloading_supervisors'));
ngToast.danger({ content: translation }); });
}
/**
* Get a supervisor by their email and updates the $scope.supToAdd element.
* The email used for search is fetched from $scope.email_sup.
*/
$scope.searchSup = function () {
if (!$scope.user.isOffice) {
console.log("Forbidden action. You're not an office!");
return;
}
if ($scope.inputs.email.length == 0)
return;
// Find tutor by email
$http.get(config.backend + '/sup/email/' + $scope.inputs.email)
.success(function (data) {
if (data) {
$scope.supToAdd = data;
$scope.showmessagesupfound = true;
} else {
ngToast.danger($translate.instant('sup_not_found'));
// Hide the success message (if it exists by other query)
$scope.showmessagesupfound = false;
}
})
.error(function () {
ngToast.danger($translate.instant('sup_not_found'));
});
};
/**
* Links a new supervisor
*/
$scope.confirmLink = function () {
if (!$scope.user.isOffice) {
console.log("Forbidden action. You're not an office!");
return;
}
$scope.showmessagesupfound = false;
$http
.post(config.backend+'/sup/' + $scope.supToAdd.id + '/off/' + $scope.user.id)
.success(function(data, status, headers, config) {
loadSupervisors();
ngToast.success($translate.instant('supervisor_added'));
})
.error(function(error) {
var message = typeof error == 'string' ? error : error.message;
if (message.search('already exists') > 0)
ngToast.danger($translate.instant('supervisor_already_linked'));
else if (message.search('yourself') > 0)
ngToast.danger($translate.instant('supervisor_yourself'));
else
ngToast.danger($translate.instant('no_supervisor_linked'));
}); });
};
/**
* Unlinks a supervisor
*/
$scope.unlinkSupervisor = function (id) {
if (!$scope.user.isOffice) {
console.log("Forbidden action. You're not an office!");
return;
}
$http
.delete(config.backend+'/sup/' + id + '/off/' + $scope.user.id)
.success(function(data, status, headers, config) {
loadSupervisors();
ngToast.success($translate.instant('supervisor_deleted'));
})
.error(function(data, status, headers, config) {
ngToast.danger($translate.instant('general_error'));
}); });
};
// MAIN
loadSupervisors();
}); });
...@@ -13,6 +13,29 @@ ...@@ -13,6 +13,29 @@
title="Pictogram" /> title="Pictogram" />
</a> </a>
</div> </div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li ng-class="{active: $location.url() == '/students'}">
<a href="/app/#/students">
<i class="fa fa-users" aria-hidden="true"></i> {{ 'students' | translate }}
</a>
</li>
<li ng-if="user.isOffice" ng-class="{active: $location.url() == '/supervisor/list'}">
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/supervisor/list">
<i class="fa fa-users" aria-hidden="true"></i> {{ 'supervisors' | translate }}
</a>
</li>
<li ng-if="!user.isTutor" ng-class="{active: $location.url() == '/instructions'}">
<a href="/app/#/instructions">
<i class="glyphicon glyphicon-tasks" aria-hidden="true"></i> {{ 'instructions' | translate }}
</a>
</li>
<li>
<a ng-click="own_pictos()">
<i class="glyphicon glyphicon-picture" aria-hidden="true"></i> {{ 'own_pictos' | translate }}
</a>
</li>
</ul>
<div class="topbar__supervisor nav navbar-nav navbar-right"> <div class="topbar__supervisor nav navbar-nav navbar-right">
<div class="dropdown"> <div class="dropdown">
<div class="topbar__supervisor__name"> <div class="topbar__supervisor__name">
...@@ -26,18 +49,18 @@ ...@@ -26,18 +49,18 @@
<img id="supervisor_profile" ng-src="{{user.pic}}" alt="Supervisor" title="Supervisor" /> <img id="supervisor_profile" ng-src="{{user.pic}}" alt="Supervisor" title="Supervisor" />
</div> </div>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <!-- li>
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/students"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/students">
<i class="fa fa-users" aria-hidden="true"></i> <i class="fa fa-users" aria-hidden="true"></i>
{{ 'students' | translate }} {{ 'students' | translate }}
</a> </a>
</li> </li>
<li ng-if="user.isSupAdmin == true"> <li ng-if="user.isOffice">
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/supervisor/list"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/supervisor/list">
<i class="fa fa-users" aria-hidden="true"></i> <i class="fa fa-users" aria-hidden="true"></i>
{{ 'supervisors' | translate }} {{ 'supervisors' | translate }}
</a> </a>
<li ng-if="user.isTutor == false"> <li ng-if="!user.isTutor">
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/instructions"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/instructions">
<i class="glyphicon glyphicon-tasks" aria-hidden="true"></i> <i class="glyphicon glyphicon-tasks" aria-hidden="true"></i>
{{ 'instructions' | translate }} {{ 'instructions' | translate }}
...@@ -48,7 +71,7 @@ ...@@ -48,7 +71,7 @@
<i class="glyphicon glyphicon-picture" aria-hidden="true"></i> <i class="glyphicon glyphicon-picture" aria-hidden="true"></i>
{{ 'own_pictos' | translate }} {{ 'own_pictos' | translate }}
</a> </a>
</li> </li -->
<li> <li>
<a class="pointer" role="menuitem" tabindex="0" href="/app/#/setup"> <a class="pointer" role="menuitem" tabindex="0" href="/app/#/setup">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i> <i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
...@@ -65,4 +88,5 @@ ...@@ -65,4 +88,5 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</nav> </nav>
<!-- InstructionsCtrl controls here, see app.js --> <!-- InstructionsCtrl controls here, see app.js -->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title" translate>own_instructions</h3></div> <div class="panel-heading"><h3 translate>own_instructions</h3></div>
<div class="panel-body"> <div class="panel-body">
......
<!-- SetupCtrl controls here, see app.js --> <!-- SetupCtrl controls here, see app.js -->
<div> <div>
<div class="page-header"> <div class="page-header">
<h2 translate>setup</h2> <h3 translate>setup</h3>
</div> </div>
<div> <div>
<!-- Logo Pictogram --> <!-- Logo Pictogram -->
......
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
<td> <td>
<i ng-show="student.license.isValid && !student.license.isTrial" class="fa fa-certificate fa-lg text-primary license-warning" aria-hidden="true" popover="{{ 'license_pro' | translate}}" popover-trigger="mouseenter"></i> <i ng-show="student.license.isValid && !student.license.isTrial" class="fa fa-certificate fa-lg text-primary license-warning" aria-hidden="true" popover="{{ 'license_pro' | translate}}" popover-trigger="mouseenter"></i>
<i ng-show="student.license.isTrial && student.license.isValid" class="fa fa-flask fa-lg text-warning license-warning" aria-hidden="true" popover="{{ 'trial_license' | translate}}" popover-trigger="mouseenter"></i> <i ng-show="student.license.isTrial && student.license.isValid" class="fa fa-flask fa-lg text-warning license-warning" aria-hidden="true" popover="{{ 'trial_license' | translate}}" popover-trigger="mouseenter"></i>
<i ng-show="!student.license.isValid" class="fa fa-exclamation-circle fa-lg text-danger license-warning" aria-hidden="true" popover="{{ 'license_missing' | translate}}" popover-trigger="mouseenter"></i> <i ng-show="!student.license.isValid && student.license.isOfficial" class="fa fa-certificate fa-lg text-danger license-warning" aria-hidden="true" popover="{{ 'license_missing_official' | 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>{{student.surname}}, {{student.name}}</h4>
...@@ -53,12 +54,12 @@ ...@@ -53,12 +54,12 @@
<a <a
class="btn btn-default btn-lg" role="button" href="/app/#/student/{{student.id}}/collections" class="btn btn-default btn-lg" role="button" href="/app/#/student/{{student.id}}/collections"
alt="{{ 'collections' | translate }}" popover="{{ 'collections' | translate }}" popover-trigger="mouseenter" ng-if="student.license.isValid"> alt="{{ 'collections' | translate }}" popover="{{ 'collections' | translate }}" popover-trigger="mouseenter" ng-if="student.license.isValid || student.license.isOfficial">
<span class="glyphicon glyphicon-th" aria-hidden="true"></span> <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
</a> </a>
<span <span
class="btn btn-default btn-lg" role="button" class="btn btn-default btn-lg" role="button"
alt="{{ 'collections' | translate }}" popover="{{ 'collections' | translate }}" popover-trigger="mouseenter" ng-if="!student.license.isValid"> alt="{{ 'collections' | translate }}" popover="{{ 'collections' | translate }}" popover-trigger="mouseenter" ng-if="!student.license.isValid && student.license.isTrial">
<span class="glyphicon glyphicon-th" aria-hidden="true" style="color: #bbb" ></span> <span class="glyphicon glyphicon-th" aria-hidden="true" style="color: #bbb" ></span>
</span> </span>
......
...@@ -20,29 +20,46 @@ ...@@ -20,29 +20,46 @@
<div class="col-md-4"> <div class="col-md-4">
<legend translate>add_existing</legend> <legend translate>add_existing</legend>
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('existing')"><img src="img/child-existing.png" alt="{{'parents_tutor' | translate}}" title="{{'parents_tutor' | translate}}" /></a> <a ng-click="slide.rightTo('existing')">
</div> <img src="img/child-existing.png" alt="{{'parents_tutor' | translate}}" title="{{'parents_tutor' | translate}}"
<div> ng-class="{'img-120': hover_existing}"
<p translate>add_existing_desc</p> ng-mouseenter="hover_existing = true"
ng-mouseleave="hover_existing = false"/>
</a>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<legend translate>add_new_official</legend> <legend translate>add_new_official</legend>
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('new')"><img src="img/child-new.png" alt="{{'therapist' | translate}}" title="{{'therapist' | translate}}" /></a> <a ng-click="slide.rightTo('new')">
</div> <img src="img/child-new.png" alt="{{'therapist' | translate}}" title="{{'therapist' | translate}}"
<div> ng-class="{'img-120': hover_new}"
<p translate>add_new_official_desc</p> ng-mouseenter="hover_new = true"
ng-mouseleave="hover_new = false"/>
</a>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<legend translate>new_test_account</legend> <legend translate>new_test_account</legend>
<div class="text-center"> <div class="text-center">
<a ng-click="slide.rightTo('test')"><img src="img/child-test.png" alt="{{'office_center' | translate}}" title="{{'office_center' | translate}}" /></a> <a ng-click="slide.rightTo('test')">
<img src="img/child-test.png" alt="{{'office_center' | translate}}" title="{{'office_center' | translate}}"
ng-class="{'img-120': hover_test}"
ng-mouseenter="hover_test = true"
ng-mouseleave="hover_test = false"/>
</a>
</div>
</div> </div>
<div>
<p translate>new_test_account_desc</p>
</div> </div>
<div class="row">
<div class="col-md-4">
<p translate>add_existing_desc</p>
</div>
<div class="col-md-4">
<p translate>add_new_official_desc</p>
</div>
<div class="col-md-4">
<p translate>new_test_account_desc</p>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,37 +4,56 @@ ...@@ -4,37 +4,56 @@
<div class="panel-heading"> <div class="panel-heading">
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-4">
<h5 translate>supervisors</h5> <h3 translate>supervisors</h3>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4 margin-top20">
<div class=" input-group">
<input type="text" ng-model="inputs.email" placeholder="{{ 'email' | translate }}" class="form-control">
<span class="input-group-btn"> <button ng-click="searchSup()" class="btn btn-success btn-sm" role="button"> {{ 'link_supervisor' | translate }}</button></span>
</div> </div>
<div class="col-xs-4">
<!-- Alert and success messages for supervisor found -->
<div ng-show="{{ 'showmessagesupfound' }}" class="alert alert-info overlap-result">
<!-- Imagen de perfil del tutor -->
<img ng-src="{{supToAdd.pic}}" class="profile" alt="" title="" /> {{ supToAdd.name }} {{ supToAdd.surname }}
<a class="btn btn-default btn-sm pull-right" role="button" ng-click="confirmLink()" translate>add</a>
</div>
</div>
<div class="col-xs-4 margin-top20">
<div class=" input-group"> <div class=" input-group">
<input type="text" ng-model="search_sups" id="search_sups" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2"> <input type="text" ng-model="inputs.search_str" id="search_sups" placeholder="{{ 'filter' | translate }}" class="form-control" aria-describedby="basic-addon2">
<span class="input-group-addon"><span class="glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span></span> <span class="input-group-addon"><span class="glyphicon glyphicon-search" id="basic-addon2" aria-hidden="true"></span></span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Fin .panel-body -->
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table" id="table_supervisors">
<thead class="thead-default"> <thead class="thead-default">
<tr> <tr>
<th translate>supervisors</th> <th class="col-xs-8" translate>supervisors</th>
<th translate>students</th> <th class="col-xs-4" translate>students</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="active" ng-repeat="supervisor in supervisors_list | filter:search_sups | orderBy: 'name'"> <tr class="active" ng-repeat="supervisor in supervisors_list | filter:inputs.search_str | orderBy: 'name'">
<td> <td>
<div> <div class="row">
<div class="col-xs-2"> <div class="col-xs-2">
<div class="thumbnail"> <div class="thumbnail">
<img ng-src="/upload/supervisorAvatar/{{supervisor.pic}}" alt="Supervisor" title="Supervisor" /> <img ng-src="{{supervisor.pic}}" alt="Supervisor" title="Supervisor" />
</div> </div>
</div> </div>
<div class="col-xs-10"> <div class="col-xs-1">
<a ng-click="unlinkSupervisor(supervisor.id)" class="delete_sup" title="{{ 'unlink' | translate }}">
<span class="glyphicon glyphicon-remove-circle text-danger" aria-hidden="true"></span>
</a>
</div>
<div class="col-xs-9">
<h4>{{supervisor.name}} {{supervisor.surname}}</h4> <h4>{{supervisor.name}} {{supervisor.surname}}</h4>
<p><i class="fa fa-envelope" aria-hidden="true">&nbsp</i><a href="mailto:{{supervisor.email}}">{{supervisor.email}}</a></p> <p><i class="fa fa-envelope" aria-hidden="true">&nbsp</i><a href="mailto:{{supervisor.email}}">{{supervisor.email}}</a></p>
<p><i class="fa fa-phone-square" aria-hidden="true"></i>&nbsp<a href="tel:{{supervisor.phone}}">{{supervisor.phone}}</a></p> <p><i class="fa fa-phone-square" aria-hidden="true"></i>&nbsp<a href="tel:{{supervisor.phone}}">{{supervisor.phone}}</a></p>
...@@ -52,6 +71,9 @@ ...@@ -52,6 +71,9 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="alert alert-warning" ng-if="supervisors_list.length == 0">
<strong translate>no_supervisors</strong> {{ 'no_supervisors_desc' | translate }}
</div>
</div> </div>
</div> </div>
...@@ -58,10 +58,18 @@ ...@@ -58,10 +58,18 @@
margin-top: 15px; margin-top: 15px;
} }
.margin-top20 {
margin-top: 20px;
}
.margin-top7 { .margin-top7 {
margin-top: 7px; margin-top: 7px;
} }
.margin-top10 {
margin-top: 10px;
}
.table .table-striped .striped { .table .table-striped .striped {
background-color: lightgray !important; background-color: lightgray !important;
} }
...@@ -870,7 +878,8 @@ img.profile{ ...@@ -870,7 +878,8 @@ img.profile{
#user_tutors .list-group-item:hover .delete_tutor, #user_tutors .list-group-item:hover .delete_tutor,
#user_sups .list-group-item:hover .delete_sup, #user_sups .list-group-item:hover .delete_sup,
#table_students tr:hover .delete_stu{ #table_supervisors tr:hover .delete_sup,
#table_students tr:hover .delete_stu {
opacity: 1; opacity: 1;
} }
...@@ -1103,12 +1112,21 @@ input.editable.scene-name { ...@@ -1103,12 +1112,21 @@ input.editable.scene-name {
float: right; float: right;
} }
.float-left {
float: left;
}
/* Cambiar tamaño imagen */ /* Cambiar tamaño imagen */
.small-img { .img-200 {
margin-top: 25px; margin-top: 25px;
width: 200px; width: 200px;
} }
.img-120 {
margin-top: 25px;
width: 120px;
}
/* Estilos para ngSwitch */ /* Estilos para ngSwitch */
.switch-panel-body { .switch-panel-body {
position:relative; position:relative;
...@@ -1162,3 +1180,9 @@ input.editable.scene-name { ...@@ -1162,3 +1180,9 @@ input.editable.scene-name {
.switch-panel { .switch-panel {
overflow:hidden; overflow:hidden;
} }
.overlap-result {
z-index:20;
position:absolute;
width:100%
}
...@@ -61,13 +61,6 @@ module.exports.policies = { ...@@ -61,13 +61,6 @@ module.exports.policies = {
destroy: ['tokenAuth'], destroy: ['tokenAuth'],
}, },
OfficeController: {
getAll: true,
get: ['tokenAuth'],
getBasic: true,
supervisors: ['tokenAuth', 'isAdminOrOffice']
},
PictoController: { PictoController: {
upload: ['tokenAuth'], upload: ['tokenAuth'],
add_tag: ['tokenAuth'], add_tag: ['tokenAuth'],
...@@ -156,7 +149,10 @@ module.exports.policies = { ...@@ -156,7 +149,10 @@ module.exports.policies = {
upload: ['tokenAuth'], upload: ['tokenAuth'],
subscribe: ['tokenAuth'], subscribe: ['tokenAuth'],
unsubscribe: ['tokenAuth'], unsubscribe: ['tokenAuth'],
delete: ['tokenAuth', 'isAdmin'] delete: ['tokenAuth', 'isAdmin'],
supervisors: ['tokenAuth', 'isOffice'],
link_supervisor: ['tokenAuth', 'isOffice'],
unlink_supervisor: ['tokenAuth', 'isOffice']
}, },
TryController: { TryController: {
......
...@@ -55,11 +55,6 @@ module.exports.routes = { ...@@ -55,11 +55,6 @@ module.exports.routes = {
'PUT /method/template/:id': 'MetaMethodController.update', 'PUT /method/template/:id': 'MetaMethodController.update',
'DELETE /method/template/:id': 'MetaMethodController.destroy', 'DELETE /method/template/:id': 'MetaMethodController.destroy',
'GET /office/get_all': 'OfficeController.getAll',
'GET /office/:code': 'OfficeController.getBasic',
'GET /office/get/:id': 'OfficeController.get',
'GET /office/get/:id/supervisors': 'OfficeController.supervisors',
'GET /picto/:lang/pic_categories/:id_cat': 'PictoController.categories', 'GET /picto/:lang/pic_categories/:id_cat': 'PictoController.categories',
'GET /picto/:lang/pic_fromcategory/:id_cat': 'PictoController.fromcategory', 'GET /picto/:lang/pic_fromcategory/:id_cat': 'PictoController.fromcategory',
'GET /picto/:lang/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx', 'GET /picto/:lang/pic_fromSymbolStx/page/:page/limit/:limit': 'PictoController.fromSymbolStx',
...@@ -126,6 +121,9 @@ module.exports.routes = { ...@@ -126,6 +121,9 @@ module.exports.routes = {
'GET /sup/all': 'SupervisorController.list', 'GET /sup/all': 'SupervisorController.list',
'GET /sup/:id/students': 'SupervisorController.students', 'GET /sup/:id/students': 'SupervisorController.students',
'GET /sup/:id/supervisors': 'SupervisorController.supervisors',
'POST /sup/:id_sup/off/:id_off': 'SupervisorController.link_supervisor',
'DELETE /sup/:id_sup/off/:id_off': 'SupervisorController.unlink_supervisor',
'GET /sup/:id/pictos': 'SupervisorController.pictos', 'GET /sup/:id/pictos': 'SupervisorController.pictos',
'GET /sup/email/:email': 'SupervisorController.getByEmail', 'GET /sup/email/:email': 'SupervisorController.getByEmail',
......
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