@ -107,9 +107,9 @@
< td > [[${alumno.correo}]]< / td >
< td > [[${alumno.correo}]]< / td >
< td > [[${alumno.correo2}]]< / td >
< td > [[${alumno.correo2}]]< / td >
< td > [[${alumno.nacionalidad}]]< / td >
< td > [[${alumno.nacionalidad}]]< / td >
< td > [[${alumno.keywords}]]< / td >
< td class = "keywords-cell" > [[${alumno.keywords}]]< / td >
< td > [[${alumno.ciclo.nombre}]]< / td >
< td > [[${alumno.ciclo.nombre}]]< / td >
< td >
< td class = "keywords-cell" >
< span th:each = "skill : ${alumno.skills}" th:text = "${skill.nombre} + ' '" > < / span >
< span th:each = "skill : ${alumno.skills}" th:text = "${skill.nombre} + ' '" > < / span >
< / td >
< / td >
@ -146,8 +146,8 @@
< div id = "modalDelete" class = "modal" >
< div id = "modalDelete" class = "modal" >
< div class = "modal-content" >
< div class = "modal-content" >
< p > ¿Estas seguro que quires borar este elemnto?< / p >
< p > ¿Estas seguro que quires borr ar este elemnto?< / p >
< span class = "delete" > Borar< / span >
< span class = "delete" > Borr ar< / span >
< span class = "close" > Cancelar< / span >
< span class = "close" > Cancelar< / span >
< / div >
< / div >
@ -270,38 +270,36 @@
iconHtml = `< i class = "delete-icon fas fa-ban" > < / i > `;
iconHtml = `< i class = "delete-icon fas fa-ban" > < / i > `;
}
}
row.innerHTML = `
row.innerHTML = `
< td >
< td >
< i class = "edit-icon fas fa-pen-square" > < / i >
< i class = "edit-icon fas fa-pen-square" > < / i >
< i class = "delete-icon fas fa-ban hide-icon" th:if = "${isAdmin}" > < / i >
< i class = "delete-icon fas fa-ban hide-icon" th:if = "${isAdmin}" > < / i >
${alumno.nombre}
${alumno.nombre}
< / td >
< / td >
< td > ${alumno.apellido}< / td >
< td > ${alumno.apellido}< / td >
< td > ${alumno.apellido2}< / td >
< td > ${alumno.apellido2}< / td >
< td > ${alumno.fechaNacimiento}< / td >
< td > ${alumno.fechaNacimiento}< / td >
< td > ${alumno.genero}< / td >
< td > ${alumno.genero}< / td >
< td > ${alumno.nia}< / td >
< td > ${alumno.nia}< / td >
< td > ${alumno.dni}< / td >
< td > ${alumno.dni}< / td >
< td > ${alumno.correo}< / td >
< td > ${alumno.correo}< / td >
< td > ${alumno.correo2}< / td >
< td > ${alumno.correo2}< / td >
< td > ${alumno.nacionalidad}< / td >
< td > ${alumno.nacionalidad}< / td >
< td > ${alumno.keywords}< / td >
< td class = "keywords-cell" > ${alumno.keywords}< / td >
< td > ${alumno.ciclo.nombre}< / td >
< td > ${alumno.ciclo.nombre}< / td >
< td >
< td class = "keywords-cell" >
${alumno.skills.map(skill => skill.nombre).join(', ')}
${alumno.skills.map(skill => skill.nombre).join(', ')}
< / td >
< / td >
`;
`;
tableBody.appendChild(row);
tableBody.appendChild(row);
});
});
document.querySelectorAll('.edit-icon').forEach(function(icon) {
document.querySelectorAll('.edit-icon').forEach(function(icon) {
icon.removeEventListener('click', handleEdit);
icon.removeEventListener('click', handleEdit);
icon.addEventListener('click', handleEdit);
icon.addEventListener('click', handleEdit);
//console.log("Edit icon event listener attached");
});
});
document.querySelectorAll('.delete-icon').forEach(function(icon) {
document.querySelectorAll('.delete-icon').forEach(function(icon) {
icon.removeEventListener('click', handleDelete);
icon.removeEventListener('click', handleDelete);
icon.addEventListener('click', handleDelete);
icon.addEventListener('click', handleDelete);
//console.log("Delete icon event listener attached");
});
});
table.style.pointerEvents = 'auto';
table.style.pointerEvents = 'auto';
@ -349,6 +347,19 @@
}
}
});
});
});
});
/////////////////MOUSE SROLL FOR KEYWORD AND SKILLS//////////////////////
// Select all elements with the 'keywords-cell' class
const cells = document.querySelectorAll('.keywords-cell');
// Add a 'wheel' event listener to each cell
cells.forEach(cell => {
cell.addEventListener('wheel', function(e) {
// Prevent the default behavior (vertical scroll)
e.preventDefault();
// Scroll horizontally instead
this.scrollLeft += e.deltaY;
}, { passive: false }); // Use passive: false to make preventDefault() work
});
< / script >
< / script >
< / body >
< / body >
< / html >
< / html >