Commit 219aaa23 by willgonzz

Merge branch 'joel-001' of https://phoebe.roshka.com/gitlab/hshah/TalentoHumano into William_001

parents 9c341edb 9eeb704f
......@@ -23,7 +23,7 @@ import com.roshka.repositorio.ExperienciaRepository;
import com.roshka.repositorio.InstitucionRepository;
import com.roshka.repositorio.PostulanteRepository;
import com.roshka.repositorio.TecnologiaRepository;
import com.roshka.utils.Helper;
import org.hibernate.jpa.TypedParameterValue;
import org.hibernate.type.IntegerType;
......@@ -95,30 +95,7 @@ public class PostulanteController {
return "postulante-form";
}
private DBFile createFile(MultipartFile file) {
// Normalize file name
String fileName = StringUtils.cleanPath(file.getOriginalFilename());
try {
// Check if the file's name contains invalid characters
if(fileName.contains("..")) {
throw new Exception("Sorry! Filename contains invalid path sequence " + fileName);
}
if(file.getSize()==0) throw new Exception("Sorry! File cant be void");;
DBFile dbFile = new DBFile(fileName, file.getContentType(), file.getBytes());
return dbFile;
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
catch(Exception ex){
ex.printStackTrace();
return null;
}
}
@PostMapping(value = "/work-with-us",consumes = "multipart/form-data")
public RedirectView guardarPostulante(@RequestPart(name = "file",required = false) MultipartFile file,@RequestPart("postulante") Postulante postulante, RedirectAttributes redirectAttributes){
//Codigo encargado de modificar postulacion si se envia mismo CI
......@@ -138,7 +115,7 @@ public class PostulanteController {
}
if(file!=null){
DBFile cv = createFile(file);
DBFile cv = Helper.createFile(file);
if(cv!=null) cv.setPostulante(postulante);
postulante.setCvFile(cv);
}
......
package com.roshka.utils;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.YearMonth;
......@@ -7,6 +8,11 @@ import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import com.roshka.modelo.DBFile;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
public class Helper {
/**
* Se espera fecha en el formato yyyy-MM-dd
......@@ -31,4 +37,29 @@ public class Helper {
return m1.until(m2, ChronoUnit.MONTHS) + 1;
}
public static DBFile createFile(MultipartFile file) {
// Normalize file name
String fileName = StringUtils.cleanPath(file.getOriginalFilename());
try {
// Check if the file's name contains invalid characters
if(fileName.contains("..")) {
throw new Exception("Sorry! Filename contains invalid path sequence " + fileName);
}
if(file.getSize()==0) throw new Exception("Sorry! File cant be void");;
DBFile dbFile = new DBFile(fileName, file.getContentType(), file.getBytes());
return dbFile;
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
catch(Exception ex){
ex.printStackTrace();
return null;
}
}
}
......@@ -145,6 +145,16 @@ function agregarFieldTecnologia(){
return;
}
for(let i=0;i<cont_tecnologia;i++){
if(tecnologias[i]!==null){
if(tecnologias[i]["tecnologia"]["id"]==formData.get("tecnologia-id")){
alert("Ya has agregado esa tecnologia!")
//cont_cargo--;
return;
}
}
}
for (const [name, value] of formData){
pairs[name] = value
}
......@@ -165,10 +175,7 @@ function agregarFieldTecnologia(){
if(tecn==null) continue;
content1 += `
<div class="col-auto" id="tecn-${index}">
${tecn.tecnologia.nombre} ( ${tecn.nivel} <i class="bi bi-star-fill"></i> ) &nbsp; <i class="bi bi-trash-fill" onclick="eliminarTecnologia(event)"></i>
${tecn.tecnologia.nombre} ( ${tecn.nivel} <i class="bi bi-star-fill"></i> ) &nbsp; <i class="bi bi-trash-fill" onclick="eliminarTecnologia(event)"></i>
</div>
`
......@@ -259,19 +266,25 @@ function agregarFieldExpierncia(event){
const exp = experiencias[index];
if(exp==null) continue;
content += `
<div class="col border border-3" id="exp-${index}">
<center><h4>Experiencia <i class="bi bi-trash-fill" onclick="eliminarExperiencia(${index})"></i></h4></center>
<label><b>Institucion:</b> ${exp.institucion}</label><br>
<label><b>Fecha Inicio:</b> ${exp.fechaDesde}</label><br>
<label><b>Fecha Fin:</b> ${exp.fechaHasta}</label><br>
<label><b>Referencia:</b> ${exp.nombreReferencia}</label><br>
<label><b>Telefono de la referencia:</b> ${exp.telefonoReferencia}</label><br>
<label><b>Cargo:</b> ${exp.cargo}</label><br>
<label><b>Motivo de salida:</b> ${exp.motivoSalida}</label><br>
<div class="col border border-3 rounded" id="exp-${index}">
<center><h5>Experiencia <i class="bi bi-trash-fill" onclick="eliminarExperiencia(${index})"></i></h5></center>
<dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt>
<dd class="col-sm-6 text-start">${exp.institucion}</dd>
<dt class="col-sm-auto text-start">Cargo</dt>
<dd class="col-sm-6 text-start">${exp.cargo}</dd>
<dt class="col-sm-auto text-start">Referencia</dt>
<dd class="col-sm-6 text-start">${exp.nombreReferencia}</dd>
<dt class="col-sm-auto text-start">Telf. Referencia</dt>
<dd class="col-sm-6 text-start">${exp.telefonoReferencia}</dd>
<dt class="col-sm-auto text-start">Fecha Inicio</dt>
<dd class="col-sm-6 text-start">${exp.fechaDesde}</dd>
<dt class="col-sm-auto text-start">Fecha Fin</dt>
<dd class="col-sm-6 text-start">${exp.fechaHasta}</dd>
<dt class="col-sm-auto text-start">Motivo de salida</dt>
<dd class="col-sm-6 text-start">${exp.motivoSalida}</dd>
</dl>
</div>
`
}
//content += "</ul>"
......@@ -366,14 +379,22 @@ function agregarFieldEstudio(){
const est = estudios[index];
if(est==null) continue;
content += `
<div class="col border border-3" id="est-${index}">
<center><h4>Estudio <i class="bi bi-trash-fill" onclick="eliminarEstudio(${index})"></i></h4></center>
<label><b>Institucion:</b> ${est.institucion.nombre}</label><br>
<label><b>Tipo de estudio:</b> ${est.tipoDeEstudio}</label><br>
<label><b>Carrera:</b> ${est.temaDeEstudio}</label><br>
<label><b>Fecha Inicio:</b> ${est.fechaDesde}</label><br>
<label><b>Fecha Fin:</b> ${est.fechaHasta}</label><br>
<label><b>Estado:</b> ${est.estado}</label><br>
<div class="col border border-3 rounded" id="est-${index}">
<center><h5>Estudio <i class="bi bi-trash-fill" onclick="eliminarEstudio(${index})"></i></h5></center>
<dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt>
<dd class="col-sm-6 text-start">${est.institucion.nombre}</dd>
<dt class="col-sm-auto text-start">Tipo de estudio</dt>
<dd class="col-sm-6 text-start">${est.tipoDeEstudio}</dd>
<dt class="col-sm-auto text-start">Carrera</dt>
<dd class="col-sm-6 text-start">${est.temaDeEstudio}</dd>
<dt class="col-sm-auto text-start">Fecha Inicio</dt>
<dd class="col-sm-6 text-start">${est.fechaDesde}</dd>
<dt class="col-sm-auto text-start">Fecha Fin</dt>
<dd class="col-sm-6 text-start">${est.fechaHasta}</dd>
<dt class="col-sm-auto text-start">Estado</dt>
<dd class="col-sm-6 text-start">${est.estado}</dd>
</dl>
</div>
......@@ -452,7 +473,7 @@ function agregarFieldCargo(){
if(car==null) continue;
content1 += `
<div class="col-auto" id="car-${index}" style="text-transform: uppercase;">
${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML}<i class="bi bi-trash-fill" onclick="eliminarCargoPostulante(event)"></i>
${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML} &nbsp;<i class="bi bi-trash-fill" onclick="eliminarCargoPostulante(event)"></i>
</div>
......@@ -525,13 +546,16 @@ function agregarFieldReferencia(event){
const exp = referencias[index];
if(exp==null) continue;
content += `
<div class="col border border-3" id="ref-${index}">
<center><h4>Referencia Personal <i class="bi bi-trash-fill" onclick="eliminarReferencia(${index})"></i></h4></center>
<label><b>Nombre:</b> ${exp.nombre}</label><br>
<label><b>Telefono:</b> ${exp.telefono}</label><br>
<label><b>Relacion:</b> ${exp.relacion}</label><br>
<div class="col border border-3 rounded" id="ref-${index}">
<center><h5>Referencia Personal <i class="bi bi-trash-fill" onclick="eliminarReferencia(${index})"></i></h5></center>
<dl class="row row-cols-sm-2">
<dt class="col-sm-auto text-start">Nombre</dt>
<dd class="col-sm text-start">${exp.nombre}</dd>
<dt class="col-sm-auto text-start">Telefono</dt>
<dd class="col-sm text-start">${exp.telefono}</dd>
<dt class="col-sm-auto text-start">Relacion</dt>
<dd class="col-sm text-start">${exp.relacion}</dd>
</dl>
</div>
`
......
......@@ -16,7 +16,7 @@ body {
border-radius:4px;
transform:translate(-50%,10%);*/
box-shadow:3px 3px 4px rgba(175, 209, 20, 0.2)}
}
.card {
border: none
}
......@@ -197,4 +197,11 @@ dos bordes con color y que giramos con transform: rotate(-45deg);
.content-select:hover i{
margin-top: 3px;
}
h4{
color: #5e5b5b;
text-transform: capitalize;
font-size: large;
}
\ No newline at end of file
body{
background-image:url(/img/fondoIndex.jpg);
background-size:cover;
background-repeat:no-repeat;
background-repeat: no-repeat;
background-size: cover;
height:100vh;width:100vw;
background-attachment: fixed;
-webkit-text-size-adjust: 100%;
......
......@@ -40,6 +40,6 @@
</div>
</layout:put>
<layout:put block="scripts" type="APPEND">
</layout:put>
</layout:extends>
......@@ -4,6 +4,7 @@
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<layout:extends name="layouts/base.jsp">
<layout:put block="contents" type="REPLACE">
<h2 style="text-align: center;">
......@@ -131,7 +132,7 @@
<hr>
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#estadoModalLong">Actualizar</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#estadoModalLong">Actualizar</button>
</div>
<c:choose>
......@@ -153,7 +154,7 @@
<div class="col-md-6">
<div class="card h-100">
<div class="card-body">
<h6 class="d-flex align-items-center mb-3"><i class="material-icons text-info mr-2">Tecnologias</i></h6>
<h6 class="text-start fw-bold">Tecnologias</h6>
<c:forEach items="${postulante.tecnologias}" var="detalle_tecnologia">
<small>${detalle_tecnologia.getTecnologia().getNombre()}</small>
<div class="progress mb-3" style="height: 5px">
......@@ -161,7 +162,7 @@
</div>
</c:forEach>
<hr>
<h6 class="d-flex align-items-center mb-3"><i class="material-icons text-info mr-2">Cargos al que postula</i></h6>
<h6 class="text-start fw-bold">Cargos al que postula</h6>
<ul class="list-group list-group-flush">
<c:forEach items="${postulante.postulaciones}" var="convocatoria">
......@@ -184,7 +185,21 @@
<div class="carousel-inner">
<h6 class="d-flex align-items-center mb-3"><i class="material-icons text-info mr-2">Experiencias</i></h6>
<h6 class="d-flex justify-content-between fw-bold px-1">
<c:choose>
<c:when test="${postulante.experiencias.size() > 1}">
<i class="bi bi-arrow-left-circle-fill" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev"></i>
Experiencias
<i class="bi bi-arrow-right-circle-fill" data-bs-target="#carouselExampleIndicators" data-bs-slide="next"></i>
</c:when>
<c:otherwise>
Experiencias
</c:otherwise>
</c:choose>
</h6>
<c:forEach items="${postulante.experiencias}" var="detalle_experiencia" varStatus="status">
<div class="carousel-item ${status.first ? 'active' : ''}" data-bs-interval="false">
......@@ -231,14 +246,8 @@
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
......@@ -250,8 +259,20 @@
<div class="carousel-inner">
<h6 class="d-flex align-items-center mb-3"><i class="material-icons text-info mr-2">Estudios</i></h6>
<h6 class="d-flex justify-content-between fw-bold px-1">
<c:choose>
<c:when test="${postulante.experiencias.size() > 1}">
<i class="bi bi-arrow-left-circle-fill" data-bs-target="#carouselExampleIndicators1" data-bs-slide="prev"></i>
Estudios
<i class="bi bi-arrow-right-circle-fill" data-bs-target="#carouselExampleIndicators1" data-bs-slide="next"></i>
</c:when>
<c:otherwise>
Estudios
</c:otherwise>
</c:choose>
</h6>
<c:forEach items="${postulante.estudios}" var="detalle_estudios" varStatus="status">
<div class="carousel-item ${status.first ? 'active' : ''}" data-bs-interval="false">
......@@ -298,14 +319,7 @@
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators1" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators1" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
......@@ -313,7 +327,7 @@
<div class="col-md-6">
<div class="card">
<div class="card-body">
<h6 class="d-flex align-items-center mb-3"><i class="material-icons text-info mr-2">Referencias Personales</i></h6>
<h6 class="text-start fw-bold">Referencias Personales</h6>
<ul class="list-group list-group-flush">
<c:forEach items="${postulante.referencias}" var="referencia">
......@@ -337,7 +351,7 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="estadorrhhModal">Estado</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
......@@ -365,18 +379,15 @@
</form:form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<layout:put block="scripts" type="APPEND">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="../valEdad.js"></script>
</layout:put>
......
......@@ -4,6 +4,7 @@
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,400i,700,900&display=swap" rel="stylesheet">
<link rel="icon" href="../img/LogoRoshka.ico">
</head>
<style>
body {
......
......@@ -8,6 +8,7 @@
<title>Forgot Password</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous">
<link rel="icon" href="../img/LogoRoshka.ico">
</head>
<body>
......
......@@ -5,6 +5,7 @@
<layout:extends name="layouts/base.jsp">
<layout:put block="cssDeclaracion" type="REPLACE">
<link href="../css/indexStyle.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="../img/LogoRoshka.ico">
</layout:put>
</layout:extends>
\ No newline at end of file
......@@ -9,6 +9,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="icon" href="../img/LogoRoshka.ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
<layout:block name="cssDeclaracion">
<link href="../css/cargoStyle.css" rel="stylesheet" type="text/css"/>
</layout:block>
......
......@@ -9,6 +9,7 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous">
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="../img/LogoRoshka.ico">
</head>
<body>
<jsp:include page="alerts.jsp"/>
......
......@@ -197,7 +197,7 @@
</c:forEach>
</td>
<td>${postulante.estado.getEstado()}</td>
<td><a href="/postulantes/${postulante.id}">Ver</a></td>
<td><a href="/postulantes/${postulante.id}"><i class="bi bi-eye-fill"></i></a></td>
</tr>
</c:forEach>
</tbody>
......
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 to comment