Commit 87be5ebb by Joel Florentin

Llamadas a archivos estaticos por ruta absoluta.

Se cambiaron las rutas de los archivos estaticos(css, js, img) de relativo
a absoluto. Tambien el controller de RRHHPostulantes y tecnologia se unifico.
parent 4203074b
......@@ -51,10 +51,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.mvcMatchers("/cargo*").authenticated()
.mvcMatchers("/convocatoria*").authenticated()
.mvcMatchers("/convocatoria/crear/*").authenticated()
.mvcMatchers("/tecnologia*").authenticated()
.mvcMatchers("/tecnologias","/tecnologias/**").authenticated()
.mvcMatchers("/postulantes","/postulantes/**").authenticated()
.mvcMatchers("/edit-user-data").authenticated()
.mvcMatchers("/postulantesExcel*").authenticated()
.anyRequest().permitAll()
.and()
.formLogin()
......
......@@ -21,8 +21,8 @@ import org.springframework.web.servlet.view.RedirectView;
import javax.validation.ConstraintViolationException;
@Controller
@RequestMapping("/work-with-us")
public class PostulanteController {
PostulanteRepository post;
TecnologiaRepository tecRepo;
......@@ -55,7 +55,7 @@ public class PostulanteController {
}
@RequestMapping(value = "/work-with-us",method = RequestMethod.GET)
@RequestMapping(method = RequestMethod.GET)
public String getFormPostulante(Model model){
model.addAttribute("tecnologias", tecRepo.findAll());
model.addAttribute("tiposDeEstudio", TipoDeEstudio.values());
......@@ -77,7 +77,7 @@ public class PostulanteController {
}
@PostMapping(value = "/work-with-us",consumes = "multipart/form-data")
@PostMapping(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
//Codigo encargado de modificar postulacion si se envia mismo CI
......@@ -117,7 +117,7 @@ public class PostulanteController {
@GetMapping("/work-with-us/postulacion-correcta")
@GetMapping("/postulacion-correcta")
public String successPostulation(Model model){
model.addAttribute("mensaje1", "Tu informacion se ha recibido correctamente!");
model.addAttribute("mensaje2", " espera por que nos pongamos en contacto!");
......
......@@ -39,6 +39,7 @@ import java.util.List;
@Controller
@RequestMapping("/postulantes")
public class PostulanteRRHHController {
PostulanteRepository post;
TecnologiaRepository tecRepo;
......@@ -72,7 +73,7 @@ public class PostulanteRRHHController {
this.fileRepo = fileRepo;
}
@RequestMapping("/postulantes")
@RequestMapping()
public String postulantes(HttpServletRequest request, Model model,
@RequestParam(required = false)Long tecId,
@RequestParam(required = false)String nombre,
......@@ -134,7 +135,7 @@ public class PostulanteRRHHController {
}
@RequestMapping("/postulantesExcel")
@RequestMapping("/excel")
public void exportPostulantesExcel(HttpServletResponse response, Model model,
@RequestParam(required = false)Long tecId,
@RequestParam(required = false)String nombre,
......@@ -195,7 +196,7 @@ public class PostulanteRRHHController {
}
@GetMapping({"/postulantes/{postulanteId}"})
@GetMapping({"/{postulanteId}"})
public String getPostulanteDetalle(Model model, @PathVariable("postulanteId") Long postulanteId) {
Postulante p = post.findById(postulanteId).orElse(null);
model.addAttribute("postulante",p);
......@@ -206,7 +207,7 @@ public class PostulanteRRHHController {
}
@PostMapping({"/postulantes/{postulanteId}"})
@PostMapping({"/{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);
......@@ -221,7 +222,7 @@ public class PostulanteRRHHController {
return "redirect:/postulantes/"+postulanteId;
}
@GetMapping("/postulantes/cvFile/{fileId}")
@GetMapping("/cvFile/{fileId}")
public ResponseEntity<Resource> downloadFile(@PathVariable String fileId) {
// Load file from database
DBFile dbFile;
......@@ -240,7 +241,7 @@ public class PostulanteRRHHController {
}
@GetMapping("/postulantes/{id}/pdf")
@GetMapping("/{id}/pdf")
public ResponseEntity<Resource> downloadPDF(@PathVariable Long id) {
// Load file from database
PdfGenerator pdf = new PdfGenerator();
......
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@Controller
@RequestMapping("/tecnologias")
public class TecnologiaController {
TecnologiaRepository tecRepo;
......@@ -26,7 +27,7 @@ public TecnologiaController(TecnologiaRepository tecRepo){
}
@GetMapping(path = {"/tecnologia","/tecnologia/{id}"})
@GetMapping(path = {"/agregar","/modificar/{id}"})
public String addtecnologiaView(Model model,@PathVariable(required = false) Long id) {
......@@ -35,7 +36,7 @@ public String addtecnologiaView(Model model,@PathVariable(required = false) Long
return "tecnologia-form";
}
@RequestMapping("/tecnologias")
@RequestMapping()
public String menuTecnologias(Model model,@RequestParam(required = false) String nombre,@RequestParam(defaultValue = "0")Integer nroPagina) {
final Integer CANTIDAD_POR_PAGINA = 10;
Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA,Sort.by("id"));
......@@ -53,7 +54,7 @@ public String addtecnologiaView(Model model,@PathVariable(required = false) Long
return "tecnologias";
}
@PostMapping(path = {"/tecnologia","/tecnologia/{id}"})
@PostMapping(path = {"/agregar","/modificar/{id}"})
public String addtecnologia(@Valid @ModelAttribute Tecnologia tecnologia, BindingResult result, @PathVariable(required = false) Long id, Model model) {
if(result.hasErrors() || (id==null && tecRepo.existsByNombreIgnoreCase(tecnologia.getNombre()))){
model.addAttribute("mismoNombre", true);
......
......@@ -390,49 +390,49 @@
</div>
</div>
<layout:put block="scripts" type="APPEND">
<script src="../valEdad.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
document.querySelector('#pdf').addEventListener("click", async ()=>{
var buttonsRow = document.querySelector('#buttonRow');
var element = document.getElementById('element-to-print');
var carousels = document.querySelectorAll(".pdf-carousel");
var hrs = document.querySelectorAll(".lineas-pdf");
var opt = {
margin: [1, 1, 1, 1],
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 1, height: 1400, width: 1300 },
jsPDF: { unit: 'in', format: 'a2', orientation: 'portrait' }
};
buttonsRow.style.display = "none";
carousels.forEach((element)=>{
element.classList.remove('carousel-item')
});
hrs.forEach((element)=>{
element.style.display = "block"
});
await html2pdf().set(opt).from(element).toPdf().save();
buttonsRow.style.display = "block";
carousels.forEach((element)=>{
element.classList.add('carousel-item')
});
hrs.forEach((element)=>{
element.style.display = "none"
});
})
<%--location.replace("/postulantes/${postulante.id}/")--%>
</script>
</layout:put>
</layout:put>
<layout:put block="scripts" type="APPEND">
<script src="/valEdad.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
document.querySelector('#pdf').addEventListener("click", async ()=>{
var buttonsRow = document.querySelector('#buttonRow');
var element = document.getElementById('element-to-print');
var carousels = document.querySelectorAll(".pdf-carousel");
var hrs = document.querySelectorAll(".lineas-pdf");
var opt = {
margin: [1, 1, 1, 1],
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 1, height: 1400, width: 1300 },
jsPDF: { unit: 'in', format: 'a2', orientation: 'portrait' }
};
buttonsRow.style.display = "none";
carousels.forEach((element)=>{
element.classList.remove('carousel-item')
});
hrs.forEach((element)=>{
element.style.display = "block"
});
await html2pdf().set(opt).from(element).toPdf().save();
buttonsRow.style.display = "block";
carousels.forEach((element)=>{
element.classList.add('carousel-item')
});
hrs.forEach((element)=>{
element.style.display = "none"
});
})
<%--location.replace("/postulantes/${postulante.id}/")--%>
</script>
</layout:put>
</layout:extends>
......@@ -4,7 +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">
<link rel="icon" href="/img/LogoRoshka.ico">
</head>
<style>
body {
......
......@@ -8,7 +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">
<link rel="icon" href="/img/LogoRoshka.ico">
</head>
<body>
......
......@@ -4,8 +4,8 @@
<%@ 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"/>
<link rel="icon" href="../img/LogoRoshka.ico">
<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,10 +9,10 @@
<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="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"/>
<link href="/css/cargoStyle.css" rel="stylesheet" type="text/css"/>
</layout:block>
<title>RRHH</title>
......@@ -48,7 +48,7 @@
Tecnologías
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/tecnologia">Agregar</a></li>
<li><a class="dropdown-item" href="/tecnologias/agregar">Agregar</a></li>
<li><a class="dropdown-item" href="/tecnologias">Listar</a></li>
</ul>
</li>
......
......@@ -8,8 +8,8 @@
<title>Login</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 href="../css/style.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="../img/LogoRoshka.ico">
<link href="/css/style.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="/img/LogoRoshka.ico">
</head>
<body>
<jsp:include page="alerts.jsp"/>
......@@ -22,8 +22,8 @@
<form:form method="post" action="/login">
<h3>Ingresar</h3>
<div align="center">
<img src="../img/LogoRoshka.ico" class="rounded img-fluid" id="image" style="width:auto;height:auto;" alt=""/>
<div>
<img src="/img/LogoRoshka.ico" class="rounded img-fluid" id="image" style="width:auto;height:auto;" alt=""/>
</div>
<div class="form-outline mb-4">
<input type="email" id="typeEmailX-2" class="form-control form-control-lg" name="email" placeholder="example@example.com"/>
......
......@@ -11,9 +11,9 @@
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<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="icon" href="../img/LogoRoshka.ico">
<link rel="icon" href="/img/LogoRoshka.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Shippori+Antique+B1">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
......@@ -519,6 +519,6 @@
<script>
var ciudades = ${ciudades};
</script>
<script src="./main.js"></script>
<script src="/main.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<layout:extends name="layouts/base.jsp">
<layout:put block="cssDeclaracion" type="APPEND">
<link href="../css/PostulanteStyle.css" rel="stylesheet" type="text/css"/>
<link href="/css/PostulanteStyle.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</layout:put>
......@@ -22,7 +22,7 @@
<button class="btn btn-primary">Buscar</button>
</div>
<div class="col" style="float: left;">
<a href="/postulantesExcel?${query}" type="button" class="btn btn-light float-end">
<a href="/postulantes/excel?${query}" type="button" class="btn btn-light float-end">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-excel-fill" viewBox="0 0 16 16">
<path d="M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zM5.884 6.68 8 9.219l2.116-2.54a.5.5 0 1 1 .768.641L8.651 10l2.233 2.68a.5.5 0 0 1-.768.64L8 10.781l-2.116 2.54a.5.5 0 0 1-.768-.641L7.349 10 5.116 7.32a.5.5 0 1 1 .768-.64z"></path>
</svg>
......@@ -257,7 +257,7 @@
<script>
var convocatorias = ${convocatoriaC};
</script>
<script src="./Convo.js"></script>
<script src="/Convo.js"></script>
<script>
function habilitarLvlTec(){
//si se selecciono una tecnologia entonces permitir seleccionar un nivel
......
......@@ -10,7 +10,7 @@
<h5>Tecnología</h5>
</div>
<form:form
action="/tecnologia/${tecnologia.id == null ? '' : tecnologia.id}"
action="/tecnologias/${tecnologia.id == null ? 'agregar' : 'modificar/'.concat(tecnologia.id)}"
method="post"
modelAttribute="tecnologia"
class="d-flex flex-column"
......
......@@ -49,7 +49,7 @@
<th scope="row">${sta.index+1}</th>
<td>${tecnologia.getNombre()}</td>
<td><a href="/tecnologia/${tecnologia.id}"><i class="bi bi-pencil-fill"></i></a></td>
<td><a href="/tecnologias/modificar/${tecnologia.id}"><i class="bi bi-pencil-fill"></i></a></td>
</tr>
</c:forEach>
......
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