Commit 139b7976 by Joel Florentin

merge validar al menos una tecnologia o cargo en form postulante

parents eeac29e9 89dbfaec
File mode changed from 100644 to 100755
...@@ -3,10 +3,13 @@ package com.roshka.controller; ...@@ -3,10 +3,13 @@ package com.roshka.controller;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.roshka.modelo.Cargo;
import com.roshka.modelo.ConvocatoriaCargo; import com.roshka.modelo.ConvocatoriaCargo;
import com.roshka.repositorio.CargoRepository; import com.roshka.repositorio.CargoRepository;
import com.roshka.repositorio.ConvocatoriaRepository; import com.roshka.repositorio.ConvocatoriaRepository;
import org.apache.jasper.tagplugins.jstl.core.ForEach;
import org.dom4j.Branch;
import org.hibernate.jpa.TypedParameterValue; import org.hibernate.jpa.TypedParameterValue;
import org.hibernate.type.IntegerType; import org.hibernate.type.IntegerType;
import org.hibernate.type.LongType; import org.hibernate.type.LongType;
...@@ -49,24 +52,48 @@ public class ConvocatoriaController { ...@@ -49,24 +52,48 @@ public class ConvocatoriaController {
@RequestMapping(path = {"/convocatoria","/convocatoria/{id}"}) @RequestMapping(path = {"/convocatoria","/convocatoria/{id}"})
public String formConvocatoria(Model model,@PathVariable(required = false) Long id) { public String formConvocatoria(Model model,@PathVariable(required = false) Long id) {
model.addAttribute("cargos", cargoRepo.findAll()); model.addAttribute("cargos", cargoRepo.findAll());
if(id == null) model.addAttribute("convocatoria", new ConvocatoriaCargo()); if(id == null){
model.addAttribute("convocatoria", new ConvocatoriaCargo());
model.addAttribute("listaConvocatoria", convoRepo.findAll());
}
else { else {
ConvocatoriaCargo cc = convoRepo.getById(id); ConvocatoriaCargo cc = convoRepo.getById(id);
cc.setFechaFinS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaFin()))); cc.setFechaFinS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaFin())));
cc.setFechaInicioS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaInicio()))); cc.setFechaInicioS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaInicio())));
model.addAttribute("convocatoria", cc); model.addAttribute("convocatoria", cc);
model.addAttribute("listaConvocatoria", convoRepo.findAll());
} }
return "convocatoria-form"; return "convocatoria-form";
} }
@PostMapping(path = {"/convocatoria","/convocatoria/{id}"}) @PostMapping(path = {"/convocatoria","/convocatoria/{id}"})
public String guardarConvocatoria(@ModelAttribute ConvocatoriaCargo convocatoria, BindingResult result, @PathVariable(required = false) Long id) { public String guardarConvocatoria(@ModelAttribute ConvocatoriaCargo convocatoria, BindingResult result, @PathVariable(required = false) Long id,Model model) {
if(result.hasErrors()); if(result.hasErrors());
if(id != null) convocatoria.setId(id); if(id != null) convocatoria.setId(id);
convoRepo.save(convocatoria); //System.out.println(convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId()));
System.out.println(convocatoria.getFechaInicio()); for(ConvocatoriaCargo c: convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId())){
if(result.hasErrors() || c.getCargoId()==convocatoria.getCargoId() && c.getFechaFin().after(convocatoria.getFechaInicio()) )
{
model.addAttribute("existeFecha", true);
System.out.println("no debe");
return "convocatoria-form";
}
else{
convoRepo.save(convocatoria);
System.out.println("si anda");
break;
}
}
return "redirect:/convocatorias"; return "redirect:/convocatorias";
} }
} }
...@@ -37,6 +37,9 @@ import org.springframework.util.StringUtils; ...@@ -37,6 +37,9 @@ import org.springframework.util.StringUtils;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.view.RedirectView;
@Controller @Controller
public class PostulanteController { public class PostulanteController {
...@@ -124,8 +127,10 @@ public class PostulanteController { ...@@ -124,8 +127,10 @@ public class PostulanteController {
} }
@PostMapping(value = "/work-with-us",consumes = "multipart/form-data") @PostMapping(value = "/work-with-us",consumes = "multipart/form-data")
public String guardarPostulante(@RequestPart(name = "file",required = false) MultipartFile file,@RequestPart("postulante") Postulante postulante){ 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 //Codigo encargado de modificar postulacion si se envia mismo CI
RedirectView redirectView = new RedirectView("/work-with-us/postulacion-correcta",true);
Postulante postulantex = post.findByNroDocument(postulante.getNroDocument()); Postulante postulantex = post.findByNroDocument(postulante.getNroDocument());
if(postulantex != null){ if(postulantex != null){
estudioRepository.findByPostulante(postulantex).forEach(x -> estudioRepository.delete(x)); estudioRepository.findByPostulante(postulantex).forEach(x -> estudioRepository.delete(x));
...@@ -138,11 +143,8 @@ public class PostulanteController { ...@@ -138,11 +143,8 @@ public class PostulanteController {
if(cv!=null) cv.setPostulante(postulante); if(cv!=null) cv.setPostulante(postulante);
postulante.setCvFile(cv); postulante.setCvFile(cv);
} }
postulante.getTecnologias().stream().filter( postulante.getTecnologias().stream().filter(tec -> tec.getTecnologia().getId() != 0)
tec -> tec.getTecnologia().getId() != 0 .forEach(tec -> tec.setTecnologia(tecRepo.getById(tec.getTecnologia().getId())));
).forEach(
tec -> tec.setTecnologia(tecRepo.getById(tec.getTecnologia().getId()))
);
for(Estudio estudio: postulante.getEstudios()){ for(Estudio estudio: postulante.getEstudios()){
String nombreIns = ""; String nombreIns = "";
...@@ -154,8 +156,13 @@ public class PostulanteController { ...@@ -154,8 +156,13 @@ public class PostulanteController {
estudio.setInstitucion(institucion); estudio.setInstitucion(institucion);
} }
} }
if(postulante.getPostulaciones().isEmpty() || postulante.getTecnologias().isEmpty()){
redirectView.setUrl("/postulante");
redirectAttributes.addFlashAttribute("error", "Datos invalidos");
return redirectView;
}
post.save(postulante); post.save(postulante);
return "redirect:/work-with-us/postulacion-correcta"; return redirectView;
} }
......
...@@ -67,17 +67,21 @@ public class RRHHUserController { ...@@ -67,17 +67,21 @@ public class RRHHUserController {
} }
@PostMapping("/process_register") @PostMapping("/process_register")
public String processRegister(HttpServletRequest request, RRHHUser user) { public RedirectView processRegister(HttpServletRequest request, RRHHUser user, RedirectAttributes redirectAttributes) {
RedirectView redirectView = new RedirectView("/register",true);
redirectAttributes.addFlashAttribute("success", "Datos actualizados");
if(Long.parseLong(request.getParameter("registrationCode")) != REGISTER_CODE){ if(Long.parseLong(request.getParameter("registrationCode")) != REGISTER_CODE){
return "redirect:/register"; redirectAttributes.addFlashAttribute("error", "Codigo Incorrecto");
return redirectView;
} }
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String encodedPassword = passwordEncoder.encode(user.getPassword()); String encodedPassword = passwordEncoder.encode(user.getPassword());
user.setPassword(encodedPassword); user.setPassword(encodedPassword);
rrhhUserRepository.save(user); rrhhUserRepository.save(user);
redirectView.setUrl("/login");
return "register_success"; redirectAttributes.addFlashAttribute("success", "Registro Correcto");
return redirectView;
} }
@GetMapping("/edit-user-data") @GetMapping("/edit-user-data")
......
...@@ -15,4 +15,7 @@ public interface ConvocatoriaRepository extends JpaRepository<ConvocatoriaCargo, ...@@ -15,4 +15,7 @@ public interface ConvocatoriaRepository extends JpaRepository<ConvocatoriaCargo,
//public List<ConvocatoriaCargo> findConvocatoriaCargoByCargo(Date fechaFinal); //public List<ConvocatoriaCargo> findConvocatoriaCargoByCargo(Date fechaFinal);
@Query("select c from ConvocatoriaCargo c where ( ?1 is null and ?3 is null) or ( ( ( (c.fechaFin > ?2 and ?3 = 1) or (c.fechaFin < ?2 and ?3 = 0)) or ?3 is null ) and (c.cargoId = ?1 or ?1 is null) )") @Query("select c from ConvocatoriaCargo c where ( ?1 is null and ?3 is null) or ( ( ( (c.fechaFin > ?2 and ?3 = 1) or (c.fechaFin < ?2 and ?3 = 0)) or ?3 is null ) and (c.cargoId = ?1 or ?1 is null) )")
public List<ConvocatoriaCargo> f1ndByCargoAndEstado(TypedParameterValue cargoId, Date fecha, TypedParameterValue isOpen); public List<ConvocatoriaCargo> f1ndByCargoAndEstado(TypedParameterValue cargoId, Date fecha, TypedParameterValue isOpen);
@Query("SELECT c FROM ConvocatoriaCargo c WHERE (cargoId=?1)")
public List<ConvocatoriaCargo> filtrarConvocatoriasPorCargo(Long cargoId);
} }
...@@ -80,4 +80,8 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> { ...@@ -80,4 +80,8 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
@Query("UPDATE Postulante p SET p.comentarioRRHH = ?1 WHERE p.id = ?2") @Query("UPDATE Postulante p SET p.comentarioRRHH = ?1 WHERE p.id = ?2")
void setPostulanteEstadoComentario( String comentario, Long Id);*/ void setPostulanteEstadoComentario( String comentario, Long Id);*/
@Query("SELECT p FROM Postulante p JOIN Estudio e ON p.id=e.postulante.id "+
"where e.temaDeEstudio=?1")
public List<Postulante> obtenerPostulantesPorCarrera(String carrera);
} }
...@@ -97,7 +97,7 @@ function agregarFieldExpierncia(event){ ...@@ -97,7 +97,7 @@ function agregarFieldExpierncia(event){
content += ` content += `
<li id="exp-${index}"> <li id="exp-${index}">
${exp.institucion} ${exp.institucion}
<button type="button" onclick="eliminarExperiencia(event)"> <span class="glyphicon glyphicon-trash"></span> Eliminar</button> <button type="button" class="btn btn-primary" onclick="eliminarExperiencia(event)"> <span class="glyphicon glyphicon-trash"></span> Eliminar</button>
</li> </li>
` `
...@@ -159,7 +159,7 @@ function agregarFieldTecnologia(){ ...@@ -159,7 +159,7 @@ function agregarFieldTecnologia(){
content1 += ` content1 += `
<li id="tecn-${index}"> <li id="tecn-${index}">
${tecn.tecnologia.nombre} ${tecn.tecnologia.nombre}
<button type="button" onclick="eliminarTecnologia(event)">Eliminar</button> <button type="button" class="btn btn-primary" onclick="eliminarTecnologia(event)">Eliminar</button>
<br> <br>
</li> </li>
...@@ -192,7 +192,6 @@ function serializeJSON (form) { ...@@ -192,7 +192,6 @@ function serializeJSON (form) {
// Create a new FormData object // Create a new FormData object
const formData = new FormData(form); const formData = new FormData(form);
// Create an object to hold the name/value pairs // Create an object to hold the name/value pairs
const pairs = {}; const pairs = {};
...@@ -205,7 +204,23 @@ function serializeJSON (form) { ...@@ -205,7 +204,23 @@ function serializeJSON (form) {
pairs["tecnologias"] = tecnologias.filter(tec => tec)//eliminacion de nulos pairs["tecnologias"] = tecnologias.filter(tec => tec)//eliminacion de nulos
pairs["postulaciones"] = postulaciones.filter(car => car)//eliminacion de nulos pairs["postulaciones"] = postulaciones.filter(car => car)//eliminacion de nulos
pairs["referencias"] = referencias.filter(tec => tec) pairs["referencias"] = referencias.filter(tec => tec)
if(pairs["postulaciones"].length<1){
document.querySelector("#no-valid-cargo").style.display = "block";
noValidateFlag = true;
}else{
document.querySelector("#no-valid-cargo").style.display = "none";
}
console.log(pairs["tecnologias"])
if(pairs["tecnologias"].length<1){
document.querySelector("#no-valid-tecno").style.display = "block";
noValidateFlag = true;
}else{
document.querySelector("#no-valid-tecno").style.display = "none";
}
if(noValidateFlag){
return;
}
noValidateFlag = false
// Return the JSON string // Return the JSON string
return JSON.stringify(pairs, null, 2); return JSON.stringify(pairs, null, 2);
...@@ -235,7 +250,10 @@ async function postData(url = '', data = {}) { ...@@ -235,7 +250,10 @@ async function postData(url = '', data = {}) {
body: data // body data type must match "Content-Type" header body: data // body data type must match "Content-Type" header
} }
senddata["headers"][headerxs] = token; senddata["headers"][headerxs] = token;
const response = await fetch(url, senddata); let response = null
if(!noValidateFlag){
response = await fetch(url, senddata);
}
return response; // parses JSON response into native JavaScript objects return response; // parses JSON response into native JavaScript objects
} }
...@@ -270,7 +288,6 @@ form.addEventListener("submit",(evt)=>{ ...@@ -270,7 +288,6 @@ form.addEventListener("submit",(evt)=>{
noValidateFlag = false noValidateFlag = false
} ); } );
document.querySelector("#btn-new-tech").addEventListener('click',()=>{document.querySelector("#tecnologia-nombre").classList.remove('d-none')})
//Metodos para Estudios //Metodos para Estudios
...@@ -339,7 +356,7 @@ function agregarFieldEstudio(){ ...@@ -339,7 +356,7 @@ function agregarFieldEstudio(){
content += ` content += `
<li id="est-${index}"> <li id="est-${index}">
${est.institucion.nombre} ${est.institucion.nombre}
<button type="button" onclick="eliminarEstudio(event)">Eliminar</button> <button type="button" class="btn btn-primary" onclick="eliminarEstudio(event)">Eliminar</button>
</li> </li>
` `
...@@ -400,7 +417,7 @@ function agregarFieldCargo(){ ...@@ -400,7 +417,7 @@ function agregarFieldCargo(){
if(postulaciones[i]!==null){ if(postulaciones[i]!==null){
if(postulaciones[i]["id"]===pairs["cargo-id"]){ if(postulaciones[i]["id"]===pairs["cargo-id"]){
alert("Ya has agregado ese cargo!") alert("Ya has agregado ese cargo!")
cont_cargo--; //cont_cargo--;
return; return;
} }
} }
...@@ -420,8 +437,8 @@ function agregarFieldCargo(){ ...@@ -420,8 +437,8 @@ function agregarFieldCargo(){
if(car==null) continue; if(car==null) continue;
content1 += ` content1 += `
<li id="car-${index}"> <li id="car-${index}">
${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML} ${document.querySelector('[name=cargo-id] > option[value="'+car.id+'"]').innerHTML}<br>
<button type="button" onclick="eliminarCargoPostulante(event)">Eliminar</button> <button type="button" class="btn btn-primary" onclick="eliminarCargoPostulante(event)">Eliminar</button>
</li> </li>
` `
...@@ -522,7 +539,7 @@ function agregarFieldReferencia(event){ ...@@ -522,7 +539,7 @@ function agregarFieldReferencia(event){
content += ` content += `
<li id="exp-${index}"> <li id="exp-${index}">
${exp.nombre} ${exp.nombre}
<button type="button" onclick="eliminarReferencia(event)"> <span class="glyphicon glyphicon-trash"></span> Tras</button> <button type="button" class="btn btn-primary" onclick="eliminarReferencia(event)"> <span class="glyphicon glyphicon-trash"></span> Tras</button>
</li> </li>
` `
...@@ -546,57 +563,57 @@ function eliminarReferencia(event) { ...@@ -546,57 +563,57 @@ function eliminarReferencia(event) {
/*--------------------------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------------------------- */
$(function(){ // $(function(){
$("#wizard").steps({ // $("#wizard").steps({
headerTag: "h4", // headerTag: "h4",
bodyTag: "section", // bodyTag: "section",
transitionEffect: "fade", // transitionEffect: "fade",
enableAllSteps: true, // enableAllSteps: true,
transitionEffectSpeed: 500, // transitionEffectSpeed: 500,
onStepChanging: function (event, currentIndex, newIndex) { // onStepChanging: function (event, currentIndex, newIndex) {
if ( newIndex === 1 ) { // if ( newIndex === 1 ) {
$('.steps ul').addClass('step-2'); // $('.steps ul').addClass('step-2');
} else { // } else {
$('.steps ul').removeClass('step-2'); // $('.steps ul').removeClass('step-2');
} // }
if ( newIndex === 2 ) { // if ( newIndex === 2 ) {
$('.steps ul').addClass('step-3'); // $('.steps ul').addClass('step-3');
} else { // } else {
$('.steps ul').removeClass('step-3'); // $('.steps ul').removeClass('step-3');
} // }
//
if ( newIndex === 3 ) { // if ( newIndex === 3 ) {
$('.steps ul').addClass('step-4'); // $('.steps ul').addClass('step-4');
$('.actions ul').addClass('step-last'); // $('.actions ul').addClass('step-last');
} else { // } else {
$('.steps ul').removeClass('step-4'); // $('.steps ul').removeClass('step-4');
$('.actions ul').removeClass('step-last'); // $('.actions ul').removeClass('step-last');
} // }
return true; // return true;
}, // },
labels: { // labels: {
finish: "Order again", // finish: "Order again",
next: "Next", // next: "Next",
previous: "Previous" // previous: "Previous"
} // }
}); // });
// Custom Steps Jquery Steps // // Custom Steps Jquery Steps
$('.wizard > .steps li a').click(function(){ // $('.wizard > .steps li a').click(function(){
$(this).parent().addClass('checked'); // $(this).parent().addClass('checked');
$(this).parent().prevAll().addClass('checked'); // $(this).parent().prevAll().addClass('checked');
$(this).parent().nextAll().removeClass('checked'); // $(this).parent().nextAll().removeClass('checked');
}); // });
// Custom Button Jquery Steps // // Custom Button Jquery Steps
$('.forward').click(function(){ // $('.forward').click(function(){
$("#wizard").steps('next'); // $("#wizard").steps('next');
}) // })
$('.backward').click(function(){ // $('.backward').click(function(){
$("#wizard").steps('previous'); // $("#wizard").steps('previous');
}) // })
// Checkbox // // Checkbox
$('.checkbox-circle label').click(function(){ // $('.checkbox-circle label').click(function(){
$('.checkbox-circle label').removeClass('active'); // $('.checkbox-circle label').removeClass('active');
$(this).addClass('active'); // $(this).addClass('active');
}) // })
}) // })
/*--------------------------------------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------------------------------------- */
\ No newline at end of file
...@@ -9,13 +9,19 @@ ...@@ -9,13 +9,19 @@
<div class="p-3 mb-2 bg-light text-dark border border-light "> <div class="p-3 mb-2 bg-light text-dark border border-light ">
<form:form action="/convocatoria/${convocatoria.id == null ? '' : convocatoria.id}" method="post" modelAttribute="convocatoria"> <form:form action="/convocatoria/${convocatoria.id == null ? '' : convocatoria.id}" method="post" modelAttribute="convocatoria">
<div class="mb-3 col-3"> <div class="mb-3 col-3">
<form:label path="fechaInicioS" class="form-label">Fecha inicial</form:label> <form:label path="fechaInicioS" class="form-label ">Fecha inicial</form:label>
<form:input type="date" class="form-control" path="fechaInicioS" required="true"/> <form:input type="date" path="fechaInicioS" required="true" class="form-control ${ existeFecha ? 'is-invalid' : ''}" placeholder="Fecha requerida" requiered="true" />
<div id="validationServerUsernameFeedback1" class="invalid-feedback">
Esta fecha ya existe
</div>
</div> </div>
<div class="mb-3 col-3"> <div class="mb-3 col-3">
<form:label path="fechaFinS" class="form-label">Fecha Fin</form:label> <form:label path="fechaFinS" class="form-label">Fecha Fin</form:label>
<form:input type="date" class="form-control" path="fechaFinS" required="true"/> <form:input type="date" path="fechaFinS" required="true" class="form-control ${existeFecha ? 'is-invalid': '' }" placeholder="Fecha requerida" requiered="true" />
<div id="validationServerUsernameFeedback2" class="invalid-feedback">
Esta fecha ya existe
</div>
</div> </div>
<div class="mb-3 col-3"> <div class="mb-3 col-3">
<form:label path="cupos" class="form-label">Cupos:</form:label> <form:label path="cupos" class="form-label">Cupos:</form:label>
...@@ -23,7 +29,7 @@ ...@@ -23,7 +29,7 @@
</div> </div>
<div class="mb-3 col-3"> <div class="mb-3 col-3">
<form:label path="cargoId" class="form-label">Cargo</form:label> <form:label path="cargoId" class="form-label">Cargo</form:label>
<form:select class="form-select" path="cargoId" required="true"> <form:select class="form-select" path="cargoId">
<c:forEach items="${cargos}" var="cargo"> <c:forEach items="${cargos}" var="cargo">
<form:option value="${cargo.id}">${cargo.nombre} </form:option> <form:option value="${cargo.id}">${cargo.nombre} </form:option>
</c:forEach> </c:forEach>
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</div> </div>
<button type="submit" class="btn btn-success btn-lg mb-1">Submit</button> <button type="submit" class="btn btn-success btn-lg mb-1">Submit</button>
<a href="/home" class="btn btn-danger btn-lg mr-3 ml-3 mb-1">Volver</a>
</form:form> </form:form>
</div> </div>
......
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<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://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<header> <header>
...@@ -49,11 +52,31 @@ ...@@ -49,11 +52,31 @@
<a class="nav-link" href="/edit-user-data">Editar mis datos</a> <a class="nav-link" href="/edit-user-data">Editar mis datos</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/logout">Salir</a> <%-- <a class="nav-link" href="/logout">Salir</a>--%>
<button type="button" class="btn btn-light" data-toggle="modal" data-target="#exampleModal">
Salir
</button>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
</header> </header>
\ No newline at end of file <!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="exampleModalLabel">Esta seguro que desea salir?</h6>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<a href="/logout" class="btn btn-danger">Salir</a>
</div>
</div>
</div>
</div>
\ No newline at end of file
...@@ -16,187 +16,212 @@ ...@@ -16,187 +16,212 @@
<body class="container"> <body class="container">
<form name="postulante" method="post" class="needs-validation" novalidate> <form name="postulante" method="post" class="needs-validation" novalidate>
<div class="container mt-3"> <div class="container mt-3">
<div class="card p-3 text-center"> <div class="card p-3 text-center">
<div class="d-flex flex-row justify-content-center mb-3"> <div class="d-flex flex-row justify-content-center mb-3">
</div> </div>
<h4>Curriculum</h4> <h4>Curriculum</h4>
<div class="row"> <div class="row">
<div class="about-inputs mb-3 col-md-12 center"> <div class="about-inputs mb-3 col-md-12 center">
<label for="resumen" class="form-label">Resumen</label> <label for="resumen" class="form-label">Resumen</label>
<textarea class="form-control center " name="resumen" id="resumen" required > </textarea> <textarea class="form-control center " name="resumen" id="resumen" required > </textarea>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="nombre" class="form-label">Nombre</label> <label for="nombre" class="form-label">Nombre</label>
<input type="text" name="nombre" class="form-control " id="nombre" required> <input type="text" name="nombre" class="form-control " id="nombre" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="apellido" class="form-label">Apellido</label> <label for="apellido" class="form-label">Apellido</label>
<input type="text" name="apellido" class="form-control " id="apellido" required> <input type="text" name="apellido" class="form-control " id="apellido" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="correo" class="form-label">Email address</label> <label for="correo" class="form-label">Email address</label>
<input type="email" name="correo" class="form-control " id="correo" required> <input type="email" name="correo" class="form-control " id="correo" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="nacionalidad" class="form-label"> Nacionalidad</label> <label for="nacionalidad" class="form-label"> Nacionalidad</label>
<select name="nacionalidad" id="nacionalidad" class="bg-light"> <select name="nacionalidad" id="nacionalidad" class="bg-light">
<c:forEach items="${nacionalidades}" var="nacionalidad"> <c:forEach items="${nacionalidades}" var="nacionalidad">
<option value="${nacionalidad.getDescripcion()}">${nacionalidad.getDescripcion()}</option> <option value="${nacionalidad.getDescripcion()}">${nacionalidad.getDescripcion()}</option>
</c:forEach> </c:forEach>
</select> </div> </select> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="tipoDocumento" class="form-label"> Tipo de documento</label> <label for="tipoDocumento" class="form-label"> Tipo de documento</label>
<select name="tipoDocumento" id="tipoDocumento" class="bg-light" required onchange='carg(this.value);'> <select name="tipoDocumento" id="tipoDocumento" class="bg-light" required onchange='carg(this.value);'>
<option value='CI' selected>C.I</option> <option value='CI' selected>C.I</option>
<option value='PAS'>Pasport</option> <option value='PAS'>Pasport</option>
<option value='Otro'>Otro</option> <option value='Otro'>Otro</option>
</select> </select>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="nroDocument" class="form-label">Numero de Documento</label> <label for="nroDocument" class="form-label">Numero de Documento</label>
<input type="number" name="nroDocument" class="form-control " id="nroDocument" required> <input type="number" name="nroDocument" class="form-control " id="nroDocument" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="departamentos" class="form-label"> Departamentos</label> <label for="departamentos" class="form-label"> Departamentos</label>
<select id="departamentos" class="bg-light"> <select id="departamentos" class="bg-light">
<c:forEach items="${departamentos}" var="departamentos"> <c:forEach items="${departamentos}" var="departamentos">
<option value="${departamentos.getId()}">${departamentos.getNombre()}</option> <option value="${departamentos.getId()}">${departamentos.getNombre()}</option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="ciudad" class="form-label"> Ciudad</label> <label for="ciudad" class="form-label"> Ciudad</label>
<select name="ciudadId" id="ciudad" class="bg-light"> <select name="ciudadId" id="ciudad" class="bg-light">
</select> </select>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="telefono" class="form-label">Telefono</label> <label for="telefono" class="form-label">Telefono</label>
<input type="number" name="telefono" class="form-control " id="telefono" required> <input type="number" name="telefono" class="form-control " id="telefono" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-6"> <div class="inputs mb-3 col-md-6">
<label for="fechaNacimiento" class="form-label">Fecha de nacimiento</label> <label for="fechaNacimiento" class="form-label">Fecha de nacimiento</label>
<input type="date" name="fechaNacimiento" class="form-control " id="fechaNacimiento" required> <input type="date" name="fechaNacimiento" class="form-control " id="fechaNacimiento" required>
<div class="valid-feedback"> <div class="valid-feedback">
Luce Bien! Luce Bien!
</div> </div>
</div> </div>
<div class="inputs mb-3 col-md-4"> <label for="nivelIngles" class="form-label"> Nivel de ingles</label> <div class="inputs mb-3 col-md-4"> <label for="nivelIngles" class="form-label"> Nivel de ingles</label>
<select name="nivelIngles" id="nivelIngles" class="content-select"> <select name="nivelIngles" id="nivelIngles" class="content-select">
<option value="1" selected>Ingles muy basico</option> <option value="1" selected>Ingles muy basico</option>
<option value="2" >Comprendo algunas cosas y puedo leer con la ayuda del traductor</option> <option value="2" >Comprendo algunas cosas y puedo leer con la ayuda del traductor</option>
<option value="3" >Puedo leer tranquilamente</option> <option value="3" >Puedo leer tranquilamente</option>
<option value="4" >Puedo escribir documentacion</option> <option value="4" >Puedo escribir documentacion</option>
<option value="5" >Puedo escribir y hablar tranquilamente</option> <option value="5" >Puedo escribir y hablar tranquilamente</option>
</select> </select>
</div> </div>
<div class="inputs mb-3 col-md-4"> <div class="inputs mb-3 col-md-4">
<label for="disponibilidad" class="form-label"> Disponibilidad</label> <label for="disponibilidad" class="form-label"> Disponibilidad</label>
<select name="disponibilidad" id="disponibilidad" class="content-select"> <select name="disponibilidad" id="disponibilidad" class="content-select">
<c:forEach items="${disponibilidades}" var="disponibilidad"> <c:forEach items="${disponibilidades}" var="disponibilidad">
<option value="${disponibilidad.getCode()}">${disponibilidad.getDescripcion()}</option> <option value="${disponibilidad.getCode()}">${disponibilidad.getDescripcion()}</option>
</c:forEach> </c:forEach>
</select> </div> </select> </div>
<div class="inputs mb-3 col-md-4"> <div class="inputs mb-3 col-md-4">
<label for="estadoCivil" class="form-label"> Estado Civil</label> <label for="estadoCivil" class="form-label"> Estado Civil</label>
<select name="estadoCivil" id="estadoCivil" class="content-select"> <select name="estadoCivil" id="estadoCivil" class="content-select">
<c:forEach items="${estadosCiviles}" var="estadoCivil"> <c:forEach items="${estadosCiviles}" var="estadoCivil">
<option value="${estadoCivil.getDescripcion()}">${estadoCivil.getDescripcion()}</option> <option value="${estadoCivil.getDescripcion()}">${estadoCivil.getDescripcion()}</option>
</c:forEach> </c:forEach>
</select> </div> </select> </div>
<div class="inputs mb-3 col-md-4"> <div class="inputs mb-3 col-md-4">
<label for="formFile" class="form-label">Cargar cv</label> <label for="formFile" class="form-label">Cargar cv</label>
<input class="form-control" type="file" id="cvFile"> <input class="form-control" type="file" id="cvFile">
</div> </div>
<div > <div class="inputs p-3 py-5">
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#cargoForm"><i class="fa fa-plus"></i>&nbsp;Cargo al que postulas</span></div><br> <div class="inputs d-flex justify-content-between align-items-center experience">
</div> <span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#cargoForm">
<i class="fa fa-plus"></i>&nbsp;Cargo al que postulas
<div class="mt-3 gap-2 d-flex justify-content-between" id="cargos"> </span>
</div> </div><br>
</div>
<div > <p id="no-valid-cargo" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3">
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#experienciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Experiencia</span></div><br> *Agrega por lo menos un cargo</p>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="cargos">
<div class="mt-3 gap-2 d-flex justify-content-between" id="experiencias"> </div>
</div>
<div class="inputs p-3 py-5">
<div > <div class=" inputs d-flex justify-content-between align-items-center experience">
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#estudioForm"><i class="fa fa-plus"></i>&nbsp;Agregar Estudio</span></div><br> <span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#experienciaForm">
</div> <i class="fa fa-plus"></i>&nbsp;Agregar Experiencia
</span>
<div class="mt-3 gap-2 d-flex justify-content-between" id="estudios"> </div><br>
</div> </div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="experiencias">
</div>
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#tecnologiaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Tecnologia</span></div><br>
</div> <div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience">
<span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#estudioForm">
<div class="mt-3 gap-2 d-flex justify-content-between" id="tecnologias"> <i class="fa fa-plus"></i>&nbsp;Agregar Estudio
</div> </span>
</div><br>
<div > </div>
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#referenciaForm"><i class="fa fa-plus"></i>&nbsp;Referencias Personales</span></div><br>
</div> <div class="mt-3 gap-2 d-flex justify-content-between" id="estudios">
<div class="mt-3 gap-2 d-flex justify-content-between" id="referencia"> </div>
</div>
<div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience">
<div class="mt-3 gap-2 d-flex justify-content-end"> <span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#tecnologiaForm">
<a class="px-3 btn btn-sm btn-outline-primary" href="/postulante">Cancelar</a> <i class="fa fa-plus"></i>&nbsp;Agregar Tecnologia
<button class="px-3 btn btn-sm btn-primary" type="submit">Guardar</button> </span>
</div> </div><br>
</div> </div>
</div> <p id="no-valid-tecno" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3">
</div> *Agrega por lo menos una tecnologia</p>
<div class="mt-3 gap-2 d-flex justify-content-between" id="tecnologias">
</div>
<div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience">
<span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#referenciaForm">
<i class="fa fa-plus"></i>&nbsp;Referencias Personales
</span>
</div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="referencia">
</div>
<div class="mt-3 gap-2 d-flex justify-content-end">
<a class="px-3 btn btn-sm btn-outline-primary" href="/postulante">Cancelar</a>
<button class="px-3 btn btn-sm btn-primary" type="submit">Guardar</button>
</div>
</div>
</div>
</div>
</form> </form>
<!---------------------------------------Modal de Cargos disponibles----------------------------------------------------------------> <!---------------------------------------Modal de Cargos disponibles---------------------------------------------------------------->
<div class="modal fade" id="cargoForm" tabindex="-2" role="dialog" aria-labelledby="cargoForm" aria-hidden="true"> <div class="modal fade" id="cargoForm" tabindex="-2" role="dialog" aria-labelledby="cargoForm" aria-hidden="true">
...@@ -321,7 +346,6 @@ ...@@ -321,7 +346,6 @@
<option value="${tecnologia.id}">${tecnologia.nombre}</option> <option value="${tecnologia.id}">${tecnologia.nombre}</option>
</c:forEach> </c:forEach>
</select> </select>
<button class="btn btn-outline-secondary" type="button" id="btn-new-tech">Agregar nuevo</button>
</div> </div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Registration Success</title>
<link rel="stylesheet" type="text/css" href="/webjars/bootstrap/css/bootstrap.min.css" />
</head>
<body>
<div class="container text-center">
<h3>You have signed up successfully!</h3>
<h4><a href="${pageContext.request.contextPath}/login">Click here to Login</a></h4>
</div>
</body>
</html>
\ No newline at end of file
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