Algunas mejoras a la GUI

parent f9730393
...@@ -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")
......
...@@ -67,7 +67,8 @@ public class Postulante { ...@@ -67,7 +67,8 @@ public class Postulante {
private Long nivelIngles; private Long nivelIngles;
@Column(name = "curriculum") @Column(name = "curriculum")
private String curriculum; @Lob
private byte[] curriculum;
@Column(name="estado_civil") @Column(name="estado_civil")
@NotNull @NotNull
...@@ -192,11 +193,11 @@ public class Postulante { ...@@ -192,11 +193,11 @@ public class Postulante {
this.nivelIngles = nivelIngles; this.nivelIngles = nivelIngles;
} }
public String getCurriculum() { public byte[] getCurriculum() {
return curriculum; return curriculum;
} }
public void setCurriculum(String curriculum) { public void setCurriculum(byte[] curriculum) {
this.curriculum = curriculum; this.curriculum = curriculum;
} }
......
...@@ -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,7 +52,10 @@ ...@@ -49,7 +52,10 @@
<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>
...@@ -57,3 +63,20 @@ ...@@ -57,3 +63,20 @@
</div> </div>
</nav> </nav>
</header> </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
<!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