Commit 5d08b6b8 by Joel Florentin

detalles visuales

parents 188fdf51 91549d25
......@@ -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;
}
}
}
......@@ -266,7 +266,7 @@ function agregarFieldExpierncia(event){
const exp = experiencias[index];
if(exp==null) continue;
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>
<dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt>
......@@ -379,7 +379,7 @@ function agregarFieldEstudio(){
const est = estudios[index];
if(est==null) continue;
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>
<dl class="row row-cols-md-2 gx-0 gy-2">
<dt class="col-sm-auto text-start">Institucion</dt>
......@@ -473,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>
......@@ -546,7 +546,7 @@ function agregarFieldReferencia(event){
const exp = referencias[index];
if(exp==null) continue;
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>
<dl class="row row-cols-sm-2">
<dt class="col-sm-auto text-start">Nombre</dt>
......
......@@ -15,7 +15,7 @@ body {
border-radius:4px;
transform:translate(-50%,10%);*/
box-shadow:3px 3px 4px rgba(175, 209, 20, 0.2)}
}
.card {
border: none
}
......
......@@ -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;">
......@@ -372,11 +373,8 @@
</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"/>
......
......@@ -13,6 +13,7 @@
<title>Curriculum</title>
<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="icon" href="../img/LogoRoshka.ico">
</head>
<body class="container">
......@@ -143,53 +144,30 @@
<input class="form-control" type="file" id="cvFile">
</div>
<!-- Button Agregar Cargo al que postulas -->
<hr>
<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>Cargos <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#cargoForm"></i></h3>
</div>
<div class="col-12">
<div class="mt-3 gap-2 row row-cols-4" style="display: flex;" id="cargos">
</div>
</div>
<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
</p>
</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>
<!-- Button Agregar Estudio -->
<hr>
<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>Estudios <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#estudioForm"></i></h3>
</div>
......@@ -201,12 +179,12 @@
</div>
</div>
<!-- Button Agregar Tecnologia -->
<hr>
<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>Tecnologias <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#tecnologiaForm"></i></h3>
......@@ -218,7 +196,7 @@
</div>
<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
</p>
</div>
......@@ -226,15 +204,26 @@
</div>
</div>
<!-- Button Agregar Refencia personal -->
<!-- Button Agregar Experiencia -->
<hr>
<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">
<h3>Referencia Personal <i class="bi bi-plus-circle-fill" data-bs-toggle="modal" data-bs-target="#referenciaForm"></i></h3>
</div>
......@@ -263,7 +252,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
</button>
</div>
......@@ -295,7 +284,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
</button>
</div>
......@@ -370,7 +359,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
</button>
</div>
......@@ -408,7 +397,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
</button>
</div>
......@@ -477,7 +466,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
</button>
</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