Commit 5d08b6b8 by Joel Florentin

detalles visuales

parents 188fdf51 91549d25
...@@ -23,7 +23,7 @@ import com.roshka.repositorio.ExperienciaRepository; ...@@ -23,7 +23,7 @@ import com.roshka.repositorio.ExperienciaRepository;
import com.roshka.repositorio.InstitucionRepository; import com.roshka.repositorio.InstitucionRepository;
import com.roshka.repositorio.PostulanteRepository; import com.roshka.repositorio.PostulanteRepository;
import com.roshka.repositorio.TecnologiaRepository; import com.roshka.repositorio.TecnologiaRepository;
import com.roshka.utils.Helper;
import org.hibernate.jpa.TypedParameterValue; import org.hibernate.jpa.TypedParameterValue;
import org.hibernate.type.IntegerType; import org.hibernate.type.IntegerType;
...@@ -95,30 +95,7 @@ public class PostulanteController { ...@@ -95,30 +95,7 @@ public class PostulanteController {
return "postulante-form"; 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") @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){ 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 //Codigo encargado de modificar postulacion si se envia mismo CI
...@@ -138,7 +115,7 @@ public class PostulanteController { ...@@ -138,7 +115,7 @@ public class PostulanteController {
} }
if(file!=null){ if(file!=null){
DBFile cv = createFile(file); DBFile cv = Helper.createFile(file);
if(cv!=null) cv.setPostulante(postulante); if(cv!=null) cv.setPostulante(postulante);
postulante.setCvFile(cv); postulante.setCvFile(cv);
} }
......
package com.roshka.utils; package com.roshka.utils;
import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.YearMonth; import java.time.YearMonth;
...@@ -7,6 +8,11 @@ import java.time.ZoneOffset; ...@@ -7,6 +8,11 @@ import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.Date; import java.util.Date;
import com.roshka.modelo.DBFile;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
public class Helper { public class Helper {
/** /**
* Se espera fecha en el formato yyyy-MM-dd * Se espera fecha en el formato yyyy-MM-dd
...@@ -31,4 +37,29 @@ public class Helper { ...@@ -31,4 +37,29 @@ public class Helper {
return m1.until(m2, ChronoUnit.MONTHS) + 1; 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;
}
}
} }
...@@ -266,7 +266,7 @@ function agregarFieldExpierncia(event){ ...@@ -266,7 +266,7 @@ function agregarFieldExpierncia(event){
const exp = experiencias[index]; const exp = experiencias[index];
if(exp==null) continue; if(exp==null) continue;
content += ` content += `
<div class="col border border-3" id="exp-${index}"> <div class="col border border-3 rounded" id="exp-${index}">
<center><h4>Experiencia <i class="bi bi-trash-fill" onclick="eliminarExperiencia(${index})"></i></h4></center> <center><h4>Experiencia <i class="bi bi-trash-fill" onclick="eliminarExperiencia(${index})"></i></h4></center>
<dl class="row row-cols-md-2 gx-0 gy-2"> <dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt> <dt class="col-sm-auto text-start">Institucion</dt>
...@@ -379,7 +379,7 @@ function agregarFieldEstudio(){ ...@@ -379,7 +379,7 @@ function agregarFieldEstudio(){
const est = estudios[index]; const est = estudios[index];
if(est==null) continue; if(est==null) continue;
content += ` content += `
<div class="col border border-3" id="est-${index}"> <div class="col border border-3 rounded" id="est-${index}">
<center><h4>Estudio <i class="bi bi-trash-fill" onclick="eliminarEstudio(${index})"></i></h4></center> <center><h4>Estudio <i class="bi bi-trash-fill" onclick="eliminarEstudio(${index})"></i></h4></center>
<dl class="row row-cols-md-2 gx-0 gy-2"> <dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt> <dt class="col-sm-auto text-start">Institucion</dt>
...@@ -473,7 +473,7 @@ function agregarFieldCargo(){ ...@@ -473,7 +473,7 @@ function agregarFieldCargo(){
if(car==null) continue; if(car==null) continue;
content1 += ` content1 += `
<div class="col-auto" id="car-${index}" style="text-transform: uppercase;"> <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> </div>
...@@ -546,7 +546,7 @@ function agregarFieldReferencia(event){ ...@@ -546,7 +546,7 @@ function agregarFieldReferencia(event){
const exp = referencias[index]; const exp = referencias[index];
if(exp==null) continue; if(exp==null) continue;
content += ` content += `
<div class="col border border-3" id="ref-${index}"> <div class="col border border-3 rounded" id="ref-${index}">
<center><h4>Referencia Personal <i class="bi bi-trash-fill" onclick="eliminarReferencia(${index})"></i></h4></center> <center><h4>Referencia Personal <i class="bi bi-trash-fill" onclick="eliminarReferencia(${index})"></i></h4></center>
<dl class="row row-cols-sm-2"> <dl class="row row-cols-sm-2">
<dt class="col-sm-auto text-start">Nombre</dt> <dt class="col-sm-auto text-start">Nombre</dt>
......
...@@ -15,7 +15,7 @@ body { ...@@ -15,7 +15,7 @@ body {
border-radius:4px; border-radius:4px;
transform:translate(-50%,10%);*/ transform:translate(-50%,10%);*/
box-shadow:3px 3px 4px rgba(175, 209, 20, 0.2)} }
.card { .card {
border: none border: none
} }
......
...@@ -40,6 +40,6 @@ ...@@ -40,6 +40,6 @@
</div> </div>
</layout:put> </layout:put>
<layout:put block="scripts" type="APPEND"> <layout:put block="scripts" type="APPEND">
</layout:put> </layout:put>
</layout:extends> </layout:extends>
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%> <%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<layout:extends name="layouts/base.jsp"> <layout:extends name="layouts/base.jsp">
<layout:put block="contents" type="REPLACE"> <layout:put block="contents" type="REPLACE">
<h2 style="text-align: center;"> <h2 style="text-align: center;">
...@@ -372,11 +373,8 @@ ...@@ -372,11 +373,8 @@
</div> </div>
<layout:put block="scripts" type="APPEND"> <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> <script src="../valEdad.js"></script>
</layout:put> </layout:put>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<html> <html>
<head> <head>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:400,400i,700,900&display=swap" rel="stylesheet"> <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> </head>
<style> <style>
body { body {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<title>Forgot Password</title> <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://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="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous">
<link rel="icon" href="../img/LogoRoshka.ico">
</head> </head>
<body> <body>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<layout:extends name="layouts/base.jsp"> <layout:extends name="layouts/base.jsp">
<layout:put block="cssDeclaracion" type="REPLACE"> <layout:put block="cssDeclaracion" type="REPLACE">
<link href="../css/indexStyle.css" rel="stylesheet" type="text/css"/> <link href="../css/indexStyle.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="../img/LogoRoshka.ico">
</layout:put> </layout:put>
</layout:extends> </layout:extends>
\ No newline at end of file
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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 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"> <layout:block name="cssDeclaracion">
<link href="../css/cargoStyle.css" rel="stylesheet" type="text/css"/> <link href="../css/cargoStyle.css" rel="stylesheet" type="text/css"/>
</layout:block> </layout:block>
......
...@@ -9,6 +9,7 @@ ...@@ -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://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="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 href="../css/style.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="../img/LogoRoshka.ico">
</head> </head>
<body> <body>
<jsp:include page="alerts.jsp"/> <jsp:include page="alerts.jsp"/>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<title>Curriculum</title> <title>Curriculum</title>
<link href="../css/formPostulanteStyle.css" rel="stylesheet" type="text/css"/> <link href="../css/formPostulanteStyle.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
<link rel="icon" href="../img/LogoRoshka.ico">
</head> </head>
<body class="container"> <body class="container">
...@@ -143,53 +144,30 @@ ...@@ -143,53 +144,30 @@
<input class="form-control" type="file" id="cvFile"> <input class="form-control" type="file" id="cvFile">
</div> </div>
<!-- Button Agregar Cargo al que postulas --> <!-- Button Agregar Cargo al que postulas -->
<hr>
<div class="inputs mb-3 col-md-12"> <div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 border mx-auto"> <div class="row w-100 p-3 gy-2 mx-auto">
<div class="col-12"> <div class="col-12">
<h3>Cargos <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#cargoForm"></i></h3> <h3>Cargos <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#cargoForm"></i></h3>
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="mt-3 gap-2 row row-cols-4" style="display: flex;" id="cargos"> <div class="mt-3 gap-2 row row-cols-4" style="display: flex;" id="cargos">
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">
<p id="no-valid-cargo" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3"> <p id="no-valid-cargo" style="display: none; color: red;" class="text-center">
*Agrega por lo menos un cargo *Agrega por lo menos un cargo
</p> </p>
</div> </div>
</div>
</div>
<!-- Button Agregar Experiencia -->
<div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 border mx-auto">
<div class="col-12">
<h3>Experiencias <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#experienciaForm"></i></h3>
</div>
<div class="col-12">
<div class="mt-3 gap-2 row row-cols-4" id="experiencias">
</div>
</div>
</div> </div>
</div> </div>
<!-- Button Agregar Estudio --> <!-- Button Agregar Estudio -->
<hr>
<div class="inputs mb-3 col-md-12"> <div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 border mx-auto"> <div class="row w-100 p-3 gy-2 mx-auto">
<div class="col-12"> <div class="col-12">
<h3>Estudios <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#estudioForm"></i></h3> <h3>Estudios <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#estudioForm"></i></h3>
</div> </div>
...@@ -201,12 +179,12 @@ ...@@ -201,12 +179,12 @@
</div> </div>
</div> </div>
<!-- Button Agregar Tecnologia --> <!-- Button Agregar Tecnologia -->
<hr>
<div class="inputs mb-3 col-md-12"> <div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 border mx-auto"> <div class="row w-100 p-3 gy-2 mx-auto">
<div class="col-12"> <div class="col-12">
<h3>Tecnologias <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#tecnologiaForm"></i></h3> <h3>Tecnologias <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#tecnologiaForm"></i></h3>
...@@ -218,7 +196,7 @@ ...@@ -218,7 +196,7 @@
</div> </div>
<div class="col-12"> <div class="col-12">
<p id="no-valid-tecno" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3"> <p id="no-valid-tecno" style="display: none; color: red;" class="text-center">
*Agrega por lo menos una tecnologia *Agrega por lo menos una tecnologia
</p> </p>
</div> </div>
...@@ -226,15 +204,26 @@ ...@@ -226,15 +204,26 @@
</div> </div>
</div> </div>
<!-- Button Agregar Refencia personal --> <!-- Button Agregar Experiencia -->
<hr>
<div class="inputs mb-3 col-md-12"> <div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 border mx-auto"> <div class="row w-100 p-3 gy-2 mx-auto">
<div class="col-12">
<h3>Experiencias <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#experienciaForm"></i></h3>
</div>
<div class="col-12">
<div class="mt-3 gap-2 row row-cols-4" id="experiencias">
</div>
</div>
</div>
</div>
<!-- Button Agregar Refencia personal -->
<hr>
<div class="inputs mb-3 col-md-12">
<div class="row w-100 p-3 gy-2 mx-auto">
<div class="col-12"> <div class="col-12">
<h3>Referencia Personal <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#referenciaForm"></i></h3> <h3>Referencia Personal <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#referenciaForm"></i></h3>
</div> </div>
...@@ -263,7 +252,7 @@ ...@@ -263,7 +252,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" >CargosDisponibles</h5> <h5 class="modal-title" id="exampleModalLabel" >CargosDisponibles</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:#21130d;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -295,7 +284,7 @@ ...@@ -295,7 +284,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Experiencia</h5> <h5 class="modal-title" id="exampleModalLabel">Experiencia</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:#21130d;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -370,7 +359,7 @@ ...@@ -370,7 +359,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel" >tecnologia</h5> <h5 class="modal-title" id="exampleModalLabel" >tecnologia</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:#21130d;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -408,7 +397,7 @@ ...@@ -408,7 +397,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Estudios</h5> <h5 class="modal-title" id="exampleModalLabel">Estudios</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:#21130d;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
...@@ -477,7 +466,7 @@ ...@@ -477,7 +466,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Referencias Personales</h5> <h5 class="modal-title" id="exampleModalLabel">Referencias Personales</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:#21130d;">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
......
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