postulantes.jsp 5.9 KB
Newer Older
Joel Florentin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<%@ 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">
    <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>
    <title>Lista de postulantes</title>
</head>
<body class="container">
    <div id="buscador">
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
       <form name="buscador">
         <label for="nombre">Nombre</label>
        <input type="text" name="nombre" id="nombre" value="${param.nombre}">
        <button>Buscar</button>
        <br>
          <label for="dispo">Disponbilidad</label>
          <select name="dispo" id="dispo">
            <option value="">Seleccione una opcion</option>
            <c:forEach items="${disponibilidades}" var="disponibilidad">
              <option value="${disponibilidad}" ${param.dispo == disponibilidad ? "selected" : ""}>${disponibilidad.getDescripcion()}</option>
            </c:forEach>
          </select>
          <label for="tecId">Tecnologias</label>
          <select name="tecId" id="tecId">
            <option value="">Seleccione una opcion</option>
            <c:forEach items="${tecnologias}" var="tecnologia">
              <option value="${tecnologia.id}" ${param.tecId == tecnologia.id ? "selected" : ""}>${tecnologia.nombre}</option>
            </c:forEach>
          </select>
          <label for="instId">Institucion Educativa</label>
          <select name="instId" id="instId">
            <option value="">Seleccione una opcion</option>
            <c:forEach items="${institucionesEducativas}" var="inst">
              <option value="${inst.id}" ${param.instId == inst.id ? "selected" : ""}>${inst.nombre}</option>
            </c:forEach>
          </select>
          <br>
          <label for="lvlEng">Nivel de Ingles</label>
          <select name="lvlEng" id="lvlEng">
            <option value="">Seleccione una opcion</option>
            <c:forEach var = "lvl" begin = "1" end = "5">
              <option value="${lvl}" ${param.lvlEng == lvl ? "selected" : ""}>${lvl}</option>
            </c:forEach>
          </select>
          <label for="lvlTec">Nivel de Tecnologia</label>
          <select name="lvlTec" id="lvlTec">
            <option value="">Seleccione una opcion</option>
            <c:forEach var = "lvl" begin = "1" end = "5">
              <option value="${lvl}" ${param.lvlTec == lvl ? "selected" : ""}>${lvl}</option>
            </c:forEach>
          </select>
          <label for="expInMonths">Experiencia en general</label>
          <select name="expInMonths" id="expInMonths">
            <option value="">Seleccione una opcion</option>
            <option value="6">Mayor a 6 meses</option>
            <option value="12">Mayor a 1 año</option>
            <option value="36">Mayor a 3 años</option>
            <option value="60">Mayor a 5 años</option>
          </select>
       </form>
Joel Florentin committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    </div>
    <table class="table">
        <thead>
          <tr>
            <th scope="col">#</th>
            <th scope="col">Nombre</th>
            <th scope="col">Disponibilidad</th>
            <th scope="col">Nivel de Ingles</th>
            <th scope="col">Experiencia</th>
            <th scope="col">Tecnologias</th>
          </tr>
        </thead>
        <tbody>
            <c:forEach items="${postulantes}" var="postulante" varStatus="staPost">
                <tr>
                    <th scope="row">${staPost.index + 1}</th>
                    <td>${postulante.nombre} ${postulante.apellido}</td>
                    <td>${postulante.disponibilidad.getDescripcion()}</td>
                    <td>${postulante.nivelIngles}</td>
85
                    <td>${postulante.experienciaMeses}</td>
Joel Florentin committed
86 87
                    <td>
                        <c:forEach items="${postulante.tecnologias}" var="detalle_tecnologia" varStatus="staTec">
88
                            ${detalle_tecnologia.getTecnologia().getNombre()}${not staTec.last ? "," : ""}
Joel Florentin committed
89 90
                        </c:forEach>
                    </td>
91
                    <td><a href="/postulante/${postulante.id}">Ver</a></td>
92
                </tr>
Joel Florentin committed
93
            </c:forEach>
94
          </tbody>
Joel Florentin committed
95

96 97 98 99 100 101 102 103 104
        </table>
      <div>
        <nav aria-label="Page navigation example">
          <ul class="pagination">
            <c:forEach begin="1" end="${pages}" var="nro">
              <li class="page-item"><a class="page-link" href="javascript:buscarPagina(${nro})">${nro}</a></li>
            </c:forEach>
          </ul>
        </nav>
Joel Florentin committed
105
      </div>
106 107 108 109 110 111 112 113 114
      <script>
        function habilitarLvlTec(){
          //si se selecciono una tecnologia entonces permitir seleccionar un nivel
          lvlTec.disabled = tecId.value == false
          if(lvlTec.disabled){
            lvlTec.firstElementChild.selected=true;
          }
          
        }
115 116 117 118 119 120 121 122 123 124
        function buscarPagina(nro){
          nro--
          const aBuscar = 'nroPagina='+nro
          if(!location.search) location.search = "?"+aBuscar
          const inicial = location.search.search(aBuscar);
          if(inicial==-1){//si no se encuentra y hay otros queries
            location.search = "&"+aBuscar
          }
          location.search.replace('nroPagina=',aBuscar)
        }
125 126 127 128 129
        const tecId = document.querySelector("#tecId");
        const lvlTec = document.querySelector("#lvlTec");
        tecId.addEventListener('change',habilitarLvlTec);
        habilitarLvlTec()
      </script>
130
    
Joel Florentin committed
131 132
</body>
</html>