Commit 27bb7a94 by Joaquin Elias Baranda Ayala

Actualizacion de duplicados Get and Set

parents c2acb8da 78c12fed
File mode changed from 100644 to 100755
......@@ -49,28 +49,28 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http
// .csrf().disable()
.authorizeRequests()
.antMatchers("/").authenticated()
.antMatchers("/home").authenticated()
.antMatchers("/cargo*").authenticated()
.antMatchers("/convocatoria*").authenticated()
.antMatchers("/tecnologia*").authenticated()
.antMatchers("/postulantes").authenticated()
.antMatchers("/edit-user-data").authenticated()
.mvcMatchers("/").authenticated()
.mvcMatchers("/home").authenticated()
.mvcMatchers("/cargo*").authenticated()
.mvcMatchers("/convocatoria*").authenticated()
.mvcMatchers("/tecnologia*").authenticated()
.mvcMatchers("/postulantes","/postulantes/**").authenticated()
.mvcMatchers("/edit-user-data").authenticated()
.anyRequest().permitAll()
.and()
.formLogin()
.loginPage("/login")
.usernameParameter("email")
.defaultSuccessUrl("/home")
.permitAll()
.formLogin()
.loginPage("/login")
.usernameParameter("email")
.defaultSuccessUrl("/home")
.permitAll()
.and()
.logout()
.logoutUrl("/logout")
.logoutRequestMatcher(new AntPathRequestMatcher("/logout", "GET"))
.clearAuthentication(true)
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID", "remember-me")
.logoutSuccessUrl("/login");
.logout()
.logoutUrl("/logout")
.logoutRequestMatcher(new AntPathRequestMatcher("/logout", "GET"))
.clearAuthentication(true)
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID", "remember-me")
.logoutSuccessUrl("/login");
}
}
\ No newline at end of file
......@@ -3,10 +3,13 @@ package com.roshka.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.roshka.modelo.Cargo;
import com.roshka.modelo.ConvocatoriaCargo;
import com.roshka.repositorio.CargoRepository;
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.type.IntegerType;
import org.hibernate.type.LongType;
......@@ -49,24 +52,48 @@ public class ConvocatoriaController {
@RequestMapping(path = {"/convocatoria","/convocatoria/{id}"})
public String formConvocatoria(Model model,@PathVariable(required = false) Long id) {
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 {
ConvocatoriaCargo cc = convoRepo.getById(id);
cc.setFechaFinS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaFin())));
cc.setFechaInicioS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaInicio())));
model.addAttribute("convocatoria", cc);
model.addAttribute("listaConvocatoria", convoRepo.findAll());
}
return "convocatoria-form";
}
@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(id != null) convocatoria.setId(id);
convoRepo.save(convocatoria);
System.out.println(convocatoria.getFechaInicio());
//System.out.println(convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId()));
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";
}
}
package com.roshka.controller;
import java.util.ArrayList;
import java.util.List;
import com.roshka.DTO.PostulanteListaDTO;
import com.roshka.modelo.*;
import com.roshka.modelo.Disponibilidad;
import com.roshka.modelo.EstadoPostulante;
import com.roshka.modelo.Postulante;
import com.roshka.repositorio.*;
import com.roshka.repositorio.CiudadRepository;
import com.roshka.repositorio.ConvocatoriaRepository;
import com.roshka.repositorio.DepartamentoRepository;
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.StringType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@Controller
public class PostulanteRRHHController {
PostulanteRepository post;
TecnologiaRepository tecRepo;
ExperienciaRepository expRepo;
InstitucionRepository institucionRepository;
DepartamentoRepository depRepo;
CiudadRepository ciuRepo;
EstudioRepository estudioRepository;
PostulanteTecnologiaRepository postulanteTecnologiaRepository;
ConvocatoriaRepository cargoRepo;
CargoRepository carRepo;
DBFileRepository fileRepo;
@Autowired
public PostulanteRRHHController(
PostulanteRepository post, TecnologiaRepository tecRepo, ExperienciaRepository expRepo,
InstitucionRepository institucionRepository, DepartamentoRepository depRepo,
CiudadRepository ciuRepo, EstudioRepository estudioRepository,
PostulanteTecnologiaRepository postulanteTecnologiaRepository,
ConvocatoriaRepository cargoRepo, CargoRepository carRepo, DBFileRepository fileRepo) {
this.post = post;
this.tecRepo = tecRepo;
this.expRepo = expRepo;
this.institucionRepository = institucionRepository;
this.depRepo = depRepo;
this.ciuRepo = ciuRepo;
this.estudioRepository = estudioRepository;
this.postulanteTecnologiaRepository = postulanteTecnologiaRepository;
this.cargoRepo =cargoRepo;
this.carRepo=carRepo;
this.fileRepo = fileRepo;
}
@RequestMapping("/postulantes")
public String postulantes(Model model,
@RequestParam(required = false)Long tecId,
@RequestParam(required = false)String nombre,
@RequestParam(required = false)EstadoPostulante estado,
@RequestParam(required = false)Disponibilidad dispo,
@RequestParam(required = false)Long lvlEng,
@RequestParam(required = false)Long lvlTec,
@RequestParam(required = false)Long instId,
@RequestParam(required = false)Long expInMonths,
@RequestParam(required = false)Long cargoId,
@RequestParam(required = false)Long convId,
@RequestParam(defaultValue = "0")Integer nroPagina
) {
final Integer CANTIDAD_POR_PAGINA = 5;
Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA,Sort.by("id"));
model.addAttribute("tecnologias", tecRepo.findAll());
model.addAttribute("disponibilidades", Disponibilidad.values());
model.addAttribute("institucionesEducativas", institucionRepository.findAll());
model.addAttribute("estadoP", EstadoPostulante.values());
model.addAttribute("convocatoriaC", cargoRepo.findAll());
Page<Postulante> postulantesPag = post.postulantesMultiFiltro(nombre == null || nombre.trim().isEmpty() ? new TypedParameterValue(StringType.INSTANCE,null) : new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"),dispo, lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId);
List<Postulante> postulantes = postulantesPag.getContent();
List<PostulanteListaDTO> postulantesDTO = new ArrayList<>();
for (Postulante postulante : postulantes) {
long expTotal = 0;
//Sumamos el tiempo de experiencia total en meses de cada postulante
//expTotal = postulante.getExperiencias().stream().mapToLong(e -> Helper.getMonthsDifference(e.getFechaDesde(), e.getFechaHasta())).sum();
for (Experiencia experiencia : postulante.getExperiencias()) {
expTotal += Helper.getMonthsDifference(experiencia.getFechaDesde(), experiencia.getFechaHasta());
}
if(expInMonths != null && expInMonths > expTotal) continue;
postulantesDTO.add(new PostulanteListaDTO(postulante.getId(), postulante.getNombre(), postulante.getApellido(), postulante.getDisponibilidad(), postulante.getNivelIngles(), expTotal, postulante.getTecnologias(),postulante.getEstadoPostulante(),postulante.getPostulaciones()));
}
model.addAttribute("pages", postulantesPag.getTotalPages());
model.addAttribute("postulantes", postulantesDTO);
return "postulantes";
}
@GetMapping({"/postulantes/{postulanteId}"})
public String getPostulanteDetalle(Model model, @PathVariable("postulanteId") Long postulanteId) {
Postulante p = post.findById(postulanteId).orElse(null);
model.addAttribute("postulante",p);
model.addAttribute("cvId", fileRepo.getIdByPostulante(p));
model.addAttribute("estadoP", EstadoPostulante.values());
return "detallepostulante";
}
@PostMapping({"/postulantes/{postulanteId}"})
public String setPostulanteEstado(@ModelAttribute Postulante postulante, BindingResult result, @PathVariable("postulanteId") Long postulanteId) {
//post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(),postulante.getComentarioRRHH(), postulante.getId());
Postulante postulanteVd = post.getById(postulanteId);
postulanteVd.setEstadoPostulante(postulante.getEstadoPostulante());
postulanteVd.setComentarioRRHH(postulante.getComentarioRRHH());
post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(), postulante.getComentarioRRHH(), postulanteId);
//post.save(postulanteVd);
return "redirect:/postulante/"+postulanteId;
}
@GetMapping("/postulantes/cvFile/{fileId}")
public ResponseEntity<Resource> downloadFile(@PathVariable String fileId) {
// Load file from database
DBFile dbFile;
try {
dbFile = fileRepo.findById(fileId)
.orElseThrow(() -> new Exception("File not found with id " + fileId));
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType(dbFile.getFileType()))
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + dbFile.getFileName() + "\"")
.body(new ByteArrayResource(dbFile.getData()));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return ResponseEntity.notFound().build();
}
}
}
\ No newline at end of file
......@@ -67,17 +67,21 @@ public class RRHHUserController {
}
@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){
return "redirect:/register";
redirectAttributes.addFlashAttribute("error", "Codigo Incorrecto");
return redirectView;
}
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String encodedPassword = passwordEncoder.encode(user.getPassword());
user.setPassword(encodedPassword);
rrhhUserRepository.save(user);
return "register_success";
redirectView.setUrl("/login");
redirectAttributes.addFlashAttribute("success", "Registro Correcto");
return redirectView;
}
@GetMapping("/edit-user-data")
......
package com.roshka.modelo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name = "files")
public class DBFile {
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
private String id;
private String fileName;
private String fileType;
@Lob
private byte[] data;
@OneToOne(mappedBy = "cvFile")
private Postulante postulante;
public DBFile() {
}
public DBFile(String fileName, String fileType, byte[] data) {
this.fileName = fileName;
this.fileType = fileType;
this.data = data;
}
public byte[] getData() {
return data;
}
public String getFileName() {
return fileName;
}
public String getFileType() {
return fileType;
}
public void setData(byte[] data) {
this.data = data;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public void setFileType(String fileType) {
this.fileType = fileType;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public Postulante getPostulante() {
return postulante;
}
public void setPostulante(Postulante postulante) {
this.postulante = postulante;
}
}
......@@ -72,8 +72,6 @@ public class Postulante {
@Max(value = 5)
private Long nivelIngles;
@Column(name = "curriculum")
private String curriculum;
@Column(name="estado_civil")
@NotNull
......@@ -121,110 +119,19 @@ public class Postulante {
)
private List<ConvocatoriaCargo> postulaciones;
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
@JoinColumn(name = "cvfile_id",referencedColumnName = "id")
@JsonIgnore
private DBFile cvFile;
public String getnroDocument() {
return nroDocument;
}
public void setnroDocument(String nroDocument) {
this.nroDocument = nroDocument;
}
public Date getFechaNacimiento() {
return fechaNacimiento;
}
public void setFechaNacimiento(Date fechaNacimiento) {
this.fechaNacimiento = fechaNacimiento;
}
public void setFechaNacimiento(String fechaNacimiento) {
this.fechaNacimiento = Helper.convertirFecha(fechaNacimiento);
}
public Disponibilidad getDisponibilidad() {
return disponibilidad;
}
public void setDisponibilidad(Disponibilidad disponibilidad) {
this.disponibilidad = disponibilidad;
}
public Ciudad getCiudad() {
return this.ciudad;
}
public void setCiudad(Ciudad ciudad) {
this.ciudad = ciudad;
}
public Long getCiudadId() {
return this.ciudadId;
}
public void setCiudadId(Long ciudadId) {
this.ciudadId = ciudadId;
}
public void setTipoDocumento(TipoDocumento tipoDocumento) {
this.tipoDocumento = tipoDocumento;
}
public TipoDocumento getTipoDocumento() {
return tipoDocumento;
}
public void setEstadoCivil(EstadoCivil estadoCivil) {
this.estadoCivil = estadoCivil;
}
public EstadoCivil getEstadoCivil() {
return estadoCivil;
}
public Nacionalidad getNacionalidad() {
return nacionalidad;
}
public void setNacionalidad(Nacionalidad nacionalidad) {
this.nacionalidad = nacionalidad;
}
public List<PostulanteTecnologia> getTecnologias() {
return tecnologias;
}
public void setTecnologias(List<PostulanteTecnologia> tecnologias) {
this.tecnologias = tecnologias;
}
public List<Estudio> getEstudios() {
return estudios;
}
public void setEstudios(List<Estudio> estudios) {
this.estudios = estudios;
}
public List<Experiencia> getExperiencias() {
return experiencias;
}
public void setExperiencias(List<Experiencia> experiencias) {
this.experiencias = experiencias;
}
public List<ConvocatoriaCargo> getPostulaciones() {
return postulaciones;
}
public void setPostulaciones(List<ConvocatoriaCargo> postulaciones) {
this.postulaciones = postulaciones;
}
public void setReferencias(List<ReferenciaPersonal> referencias) {
this.referencias = referencias;
}
public List<ReferenciaPersonal> getReferencias() {
return referencias;
}
public EstadoPostulante getEstadoPostulante() {
return this.estadoPostulante;
}
public void setEstadoPostulante(EstadoPostulante estadoPostulante) {
this.estadoPostulante = estadoPostulante;
}
public String getComentarioRRHH(){
return comentarioRRHH;
}
public void setComentarioRRHH(String comentarioRRHH){
this.comentarioRRHH=comentarioRRHH;
}
}
......@@ -15,4 +15,7 @@ public interface ConvocatoriaRepository extends JpaRepository<ConvocatoriaCargo,
//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) )")
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);
}
package com.roshka.repositorio;
import com.roshka.modelo.DBFile;
import com.roshka.modelo.Postulante;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
@Repository
public interface DBFileRepository extends JpaRepository<DBFile, String> {
@Query("select db.id from DBFile db where db.postulante = ?1")
public String getIdByPostulante(Postulante postulante);
}
\ No newline at end of file
......@@ -80,4 +80,8 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
@Query("UPDATE Postulante p SET p.comentarioRRHH = ?1 WHERE p.id = ?2")
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);
}
......@@ -26,3 +26,13 @@ spring.mail.properties.mail.smtp.starttls.enable=true
jsp-inheritance-prefix=/jsp/layouts/
jsp-inheritance-suffix=.jsp
## MULTIPART (MultipartProperties)
# Enable multipart uploads
spring.servlet.multipart.enabled=true
# Threshold after which files are written to disk.
spring.servlet.multipart.file-size-threshold=2KB
# Max file size.
spring.servlet.multipart.max-file-size=10MB
# Max Request Size
spring.servlet.multipart.max-request-size=10MB
\ No newline at end of file
body {
/* background-color: #506BEE; */
background-image:url(/img/fondo.png);
background-color: #baebd8;
/* background-image:url(/img/fondo2.png); */
/*background-size:cover;*/
background-repeat:repeat;
height:100vh;width:100vw;
......
......@@ -9,13 +9,19 @@
<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">
<div class="mb-3 col-3">
<form:label path="fechaInicioS" class="form-label">Fecha inicial</form:label>
<form:input type="date" class="form-control" path="fechaInicioS" required="true"/>
<form:label path="fechaInicioS" class="form-label ">Fecha inicial</form:label>
<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 class="mb-3 col-3">
<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 class="mb-3 col-3">
<form:label path="cupos" class="form-label">Cupos:</form:label>
......@@ -23,7 +29,7 @@
</div>
<div class="mb-3 col-3">
<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">
<form:option value="${cargo.id}">${cargo.nombre} </form:option>
</c:forEach>
......
......@@ -131,11 +131,18 @@
<hr>
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#estadoModalLong">actualizar</button>
</div>
<div class="col">
<a class="btn btn-link " href="#">Descargar CV</a>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#estadoModalLong">Actualizar</button>
</div>
<c:choose>
<c:when test = "${cvId != null}">
<div class="col">
<a class="btn btn-link" target="__blank" href="/postulantes/cvFile/${cvId}">Descargar CV</a>
</div>
</c:when>
</c:choose>
</div>
</div>
</div>
......@@ -239,7 +246,7 @@
<div class="col-md-6">
<div class="card">
<div class="card-body">
<div id="carouselExampleIndicators" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div id="carouselExampleIndicators1" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div class="carousel-inner">
......@@ -291,11 +298,11 @@
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
<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="#carouselExampleIndicators" data-bs-slide="next">
<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>
......@@ -358,7 +365,7 @@
</form:form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
......
......@@ -53,6 +53,7 @@
</div>
<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>
</div>
......
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ 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>
......@@ -49,11 +52,31 @@
<a class="nav-link" href="/edit-user-data">Editar mis datos</a>
</li>
<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>
</ul>
</div>
</div>
</nav>
</header>
\ No newline at end of file
</header>
<!-- 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
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-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">
<title>RRHH</title>
<link href="../css/indexStyle.css" rel="stylesheet" type="text/css"/>
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<layout:extends name="layouts/base.jsp">
<layout:put block="cssDeclaracion" type="REPLACE">
<link href="../css/indexStyle.css" rel="stylesheet" type="text/css"/>
</layout:put>
</head>
<body>
<jsp:include page="header.jsp"/>
<jsp:include page="alerts.jsp"/>
<div class="container-xxl my-md-4 bd-layout">
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>
\ No newline at end of file
</layout:extends>
\ No newline at end of file
......@@ -9,7 +9,9 @@
<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">
<layout:block name="cssDeclaracion"><link href="../css/cargoStyle.css" rel="stylesheet" type="text/css"/></layout:block>
<layout:block name="cssDeclaracion">
<link href="../css/cargoStyle.css" rel="stylesheet" type="text/css"/>
</layout:block>
<title>RRHH</title>
</head>
......@@ -54,7 +56,7 @@
Postulantes
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/postulante">Agregar</a></li>
<li><a class="dropdown-item" href="/work-with-us">Agregar</a></li>
<li><a class="dropdown-item" href="/postulantes">Listar</a></li>
</ul>
</li>
......
......@@ -98,8 +98,8 @@
<select name="ciudadId" id="ciudad" class="bg-light">
</select>
</div>
</select>
</div>
<div class="inputs mb-3 col-md-6">
<label for="telefono" class="form-label">Telefono</label>
<input type="number" name="telefono" class="form-control " id="telefono" required>
......@@ -142,46 +142,40 @@
<c:forEach items="${estadosCiviles}" var="estadoCivil">
<option value="${estadoCivil.getDescripcion()}">${estadoCivil.getDescripcion()}</option>
</c:forEach>
</select> </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="#cargoForm"><i class="fa fa-plus"></i>&nbsp;Cargo al que postulas</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="cargos">
</select>
</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="#experienciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Experiencia</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="experiencias">
<div class="inputs mb-3 col-md-4">
<label for="formFile" class="form-label">Cargar cv</label>
<input class="form-control" type="file" id="cvFile">
</div>
<!-- Button Agregar Cargo al que postulas -->
<button type="button" class="btn btn-primary"><span class="add-experience" class="btn btn-primary" data-toggle="modal" data-target="#cargoForm"><i class="fa fa-plus"></i>&nbsp;Agregar Cargo al que postulas</span></button><br>
<p id="no-valid-cargo" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3">
*Agrega por lo menos un cargo
</p>
<div class="mt-3 gap-2 row row-cols-4" style="display: flex;" id="cargos"></div>
<!-- Button Agregar Experiencia -->
<button type="button" class="btn btn-primary"><span class="add-experience" data-toggle="modal" data-target="#experienciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Experiencia</span></button><br>
<div class="mt-3 gap-2 row row-cols-4" 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="#estudioForm"><i class="fa fa-plus"></i>&nbsp;Agregar Estudio</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="estudios">
</div>
<!-- Button Agregar Estudio -->
<button type="button" class="btn btn-primary"><span class="add-experience" data-toggle="modal" data-target="#estudioForm"><i class="fa fa-plus"></i>&nbsp;Agregar Estudio</span></button><br>
<div class="mt-3 gap-2 row row-cols-4" id="estudios"></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="mt-3 gap-2 d-flex justify-content-between" id="tecnologias">
</div>
<!-- Button Agregar Tecnologia -->
<button type="button" class="btn btn-primary"><span class="add-experience" data-toggle="modal" data-target="#tecnologiaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Tecnologia</span></button><br>
<p id="no-valid-tecno" style="display: none; color: darkred; border: solid 1px darkred; border-radius: 25px; width: 75%" class="m-3">
*Agrega por lo menos una tecnologia
</p>
<div class="mt-3 gap-2 row row-cols-5" style="display: flex;" id="tecnologias">
</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="referencia">
</div>
<!-- Button Agregar Refencia personal -->
<button type="button" class="btn btn-primary"><span class="add-experience" data-toggle="modal" data-target="#referenciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Referencia Personal</span></button><br>
<div class="mt-3 gap-2 row row-cols-4" id="referencia"></div>
......@@ -245,12 +239,16 @@
<div class="inputs">
<label for="fechaDesdeExperiencia" class="form-label">Fecha Desde</label>
<input type="date" class="form-control" name="fechaDesde" id="fechaDesdeExperiencia" required>
<div class="invalid-feedback errorFechaDesde">
</div>
</div>
<div class="inputs">
<label for="fechaHastaExperiencia" class="form-label">Fecha Hasta</label>
<input type="date" class="form-control" name="fechaHasta" id="fechaHastaExperiencia" >
</div>
<div class="invalid-feedback errorfechaHasta"></div>
</div>
<div class="inputs">
<label for="cargo" class="form-label">Cargo</label>
......@@ -316,7 +314,6 @@
<option value="${tecnologia.id}">${tecnologia.nombre}</option>
</c:forEach>
</select>
<button class="btn btn-outline-secondary" type="button" id="btn-new-tech">Agregar nuevo</button>
</div>
......@@ -466,9 +463,13 @@
let fechaDesdeExperiencia = document.querySelector("#fechaDesdeExperiencia");
let fechaHastaEstudio = document.querySelector("#fechaHastaEstudio");
let fechaHastaExperiencia = document.querySelector("#fechaHastaExperiencia");
let fechaNacimiento = document.querySelector("#fechaNacimiento");
let fechas = [fechaDesdeEstudio,fechaDesdeExperiencia,fechaHastaEstudio,fechaHastaExperiencia,fechaNacimiento]
fechas.forEach(fch => fch.addEventListener('keydown',()=>false))//no dejar cargar manualmente fechas
fechaDesdeEstudio.setAttribute("max", today);
fechaDesdeExperiencia.setAttribute("max", today);
fechaNacimiento.setAttribute("max", today);
fechaDesdeExperiencia.addEventListener("change", ()=>{
fechaHastaExperiencia.setAttribute("min", fechaDesdeExperiencia.value)
......
<!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