detallepostulante.jsp 27 KB
Newer Older
1 2 3
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
4
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
5
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
6

7

8 9
<layout:extends name="layouts/base.jsp">
    <layout:put block="contents" type="REPLACE">
10
       <div id="element-to-print">
11 12
           <h2 class="mb-3" style="text-align: center;">
               Detalle Postulante ${postulante.nombre} ${postulante.apellido}
13
           </h2>
Cesar Giulano Gonzalez Maqueda committed
14
           <div class="row gy-3 container">
15 16 17 18 19 20 21 22 23 24
               <div class="col-md-6">
                   <div class="card mb-3">
                       <div class="card-body">
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Nombre</h6>
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.nombre} ${postulante.apellido}
                               </div>
25
                           </div>
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Email</h6>
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.correo}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Vive en</h6>
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.getCiudad().getNombre()}, ${postulante.getCiudad().getDepartamento().getNombre()}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
47
                                   <h6 class="mb-0">Nro de documento</h6>
48 49 50 51 52 53 54 55
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.tipoDocumento}: ${postulante.nroDocument}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
56
                                   <h6 class="mb-0">Teléfono</h6>
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.telefono}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Edad</h6>
                               </div>
                               <div id="edad" class="col-sm-9 text-secondary"></div>
                               <input style="display: none;" id="dob" value="${postulante.fechaNacimiento}">
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
73
                                   <h6 class="mb-0">Dirección</h6>
74 75 76 77 78 79 80 81
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.direccion}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
82
                                   <h6 class="mb-0">Nivel de inglés</h6>
83 84 85 86 87 88 89 90
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.nivelIngles}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
91
                                   <h6 class="mb-0">Estado civil</h6>
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.estadoCivil.getDescripcion()}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Nacionalidad</h6>
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.nacionalidad.getDescripcion()}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
                                   <h6 class="mb-0">Estado</h6>
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.estadoPostulante.getEstado()}
                               </div>
                           </div>
                           <hr>
                           <div class="row">
                               <div class="col-sm-3">
118
                                   <h6 class="mb-0">Observación</h6>
119 120 121 122 123 124
                               </div>
                               <div class="col-sm-9 text-secondary">
                                       ${postulante.getComentarioRRHH()}
                               </div>
                           </div>
                           <hr>
125 126 127
                           <div id="buttonRow" style="display: block">
                               <div class="row">
                                   <div class="col-4">
128
                                       <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#estadoModalLong">Agregar observación</button>
129 130 131 132 133 134 135 136 137 138
                                   </div>
                                   <div class="col-4">
                                       <div class="dropdown">
                                           <button class="dropdown-toggle btn btn-light" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                               PDF
                                           </button>
                                           <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                                               <li><a id="pdf" type="button" class="dropdown-item">Imagen</a></li>
                                               <li><a class="dropdown-item" target="__blank" href="/postulantes/${postulante.id}/pdf">Info</a></li>
                                           </ul>
139
                                       </div>
140 141
                                   </div>
                                   <c:choose>
142

143 144 145 146 147 148 149
                                       <c:when test = "${cvId != null}">
                                           <div class="col-4">
                                               <a class="btn btn-link" target="__blank" href="/postulantes/cvFile/${cvId}">Descargar CV</a>
                                           </div>
                                       </c:when>

                                   </c:choose>
150

151 152

                               </div>
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
                           </div>
                       </div>
                   </div>

               </div>
               <div class="col-md-6">
                   <div class="row gy-3">
                       <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 class="carousel-inner">


                                           <h6 class="d-flex justify-content-between fw-bold px-1">
                                               <c:choose>
                                                   <c:when test="${postulante.experiencias.size() > 1}">
                                                       <i class="bi bi-arrow-left-circle-fill" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev"></i>
172
                                                       Experiencia(s)
173 174 175
                                                       <i class="bi bi-arrow-right-circle-fill" data-bs-target="#carouselExampleIndicators" data-bs-slide="next"></i>
                                                   </c:when>
                                                   <c:otherwise>
176
                                                       Experiencia(s)
177 178 179 180 181 182 183
                                                   </c:otherwise>

                                               </c:choose>


                                           </h6>
                                           <c:forEach items="${postulante.experiencias}" var="detalle_experiencia" varStatus="status">
184
                                               <div class="pdf-carousel carousel-item  ${status.first ? 'active' : ''}" data-bs-interval="false">
185 186 187

                                                   <ul class="list-group list-group-flush ">
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
188
                                                           <h6 class="mb-0">Institución</h6>
189 190 191
                                                           <span class="text-secondary">${detalle_experiencia.getInstitucion()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
192
                                                           <h6 class="mb-0">Fecha inicio</h6>
193 194 195 196 197 198
                                                           <span class="text-secondary"><fmt:formatDate value="${detalle_experiencia.getFechaDesde()}" pattern="dd-MM-yyyy" /></span>
                                                           <!--    <input style="display:none;" id="fechaInicioExp" value="${detalle_experiencia.getFechaDesde()}">

                                                <span style="display: none;" class="text-secondary" id="fechaInicioExp2">${detalle_experiencia.getFechaDesde()}</span>-->
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
199
                                                           <h6 class="mb-0">Fecha fin</h6>
200 201 202 203 204 205 206 207 208
                                                           <span class="text-secondary"><fmt:formatDate value="${detalle_experiencia.getFechaHasta()}" pattern="dd-MM-yyyy" /></span>
                                                           <!--    <input style="display:none;" id="fechaFinExp" value="${detalle_experiencia.getFechaHasta()}">
                                                <span style="display: none;" class="text-secondary" id="fechaFinExp2">${detalle_experiencia.getFechaHasta()}</span>-->
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                                           <h6 class="mb-0">Referencia</h6>
                                                           <span class="text-secondary">${detalle_experiencia.getNombreReferencia()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
209
                                                           <h6 class="mb-0">Teléfono de la referencia</h6>
210 211 212 213 214 215 216 217 218 219 220
                                                           <span class="text-secondary">${detalle_experiencia.getTelefonoReferencia()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                                           <h6 class="mb-0">Cargo</h6>
                                                           <span class="text-secondary">${detalle_experiencia.getCargo()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                                           <h6 class="mb-0">Motivo de salida</h6>
                                                           <span class="text-secondary">${detalle_experiencia.getMotivoSalida()}</span>
                                                       </li>

221
                                                       <hr class="lineas-pdf" style="display: none"/>
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
                                                   </ul>
                                               </div>
                                           </c:forEach>



                                       </div>


                                   </div>
                               </div>
                           </div>
                       </div>
                       <div class="col-md-6">
                           <div class="card">
                               <div class="card-body">
                                   <div id="carouselExampleIndicators1" class="carousel carousel-dark slide" data-bs-ride="carousel">

                                       <div class="carousel-inner">

                                           <h6 class="d-flex justify-content-between fw-bold px-1">

                                               <c:choose>
245
                                                   <c:when test="${postulante.estudios.size() > 1}">
246
                                                       <i class="bi bi-arrow-left-circle-fill" data-bs-target="#carouselExampleIndicators1" data-bs-slide="prev"></i>
247
                                                       Estudio(s)
248 249 250
                                                       <i class="bi bi-arrow-right-circle-fill" data-bs-target="#carouselExampleIndicators1" data-bs-slide="next"></i>
                                                   </c:when>
                                                   <c:otherwise>
251
                                                       Estudio(s)
252 253 254 255 256
                                                   </c:otherwise>

                                               </c:choose>
                                           </h6>
                                           <c:forEach items="${postulante.estudios}" var="detalle_estudios" varStatus="status">
257
                                               <div class="pdf-carousel carousel-item  ${status.first ? 'active' : ''}" data-bs-interval="false">
258 259 260

                                                   <ul class="list-group list-group-flush ">
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
261
                                                           <h6 class="mb-0">Institución</h6>
262 263 264
                                                           <span class="text-secondary">${detalle_estudios.getInstitucion().getNombre()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
265
                                                           <h6 class="mb-0">Fecha inicio</h6>
266 267 268 269 270 271
                                                           <span class="text-secondary"><fmt:formatDate value="${detalle_estudios.getFechaDesde()}" pattern="dd-MM-yyyy" /></span>

                                                           <!-- <input style="display:none;" id="fechaInicioEst" value="${detalle_estudios.getFechaDesde()}">-->

                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
272
                                                           <h6 class="mb-0">Fecha fin</h6>
273 274 275 276 277
                                                           <span class="text-secondary"><fmt:formatDate value="${detalle_estudios.getFechaHasta()}" pattern="dd-MM-yyyy" /></span>

                                                           <!--  <input style="display:none;" id="fechaFinEst" value="${detalle_estudios.getFechaHasta()}">-->
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
278
                                                           <h6 class="mb-0">Tipo de estudio</h6>
279 280 281 282 283 284 285 286 287 288 289 290
                                                           <span class="text-secondary">${detalle_estudios.getTipoDeEstudio()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                                           <h6 class="mb-0">Tema de estudio</h6>
                                                           <span class="text-secondary">${detalle_estudios.getTemaDeEstudio()}</span>
                                                       </li>
                                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                                           <h6 class="mb-0">Estado</h6>
                                                           <span class="text-secondary">${detalle_estudios.getEstado()}</span>
                                                       </li>


291
                                                       <hr class="lineas-pdf" style="display: none"/>
292 293 294 295 296 297 298 299 300 301 302 303 304
                                                   </ul>
                                               </div>
                                           </c:forEach>



                                       </div>

                                   </div>
                               </div>
                           </div>
                       </div>
                       <div class="col-md-6">
305 306
                           <div class="card h-100">
                               <div class="card-body">
307
                                   <h6 class="text-start fw-bold">Tecnología(s)</h6>
308 309 310 311 312 313 314
                                   <c:forEach items="${postulante.tecnologias}" var="detalle_tecnologia">
                                       <small>${detalle_tecnologia.getTecnologia().getNombre()}</small>
                                       <div class="progress mb-3" style="height: 5px">
                                           <div class="progress-bar bg-primary" role="progressbar" style="width: ${(detalle_tecnologia.getNivel() / 5) * 100}%" aria-valuenow="${detalle_tecnologia.getNivel()}" aria-valuemin="1" aria-valuemax="5"></div>
                                       </div>
                                   </c:forEach>
                                   <hr>
315
                                   <h6 class="text-start fw-bold">Cargo(s) al que postula</h6>
316 317 318 319
                                   <ul class="list-group list-group-flush">
                                       <c:forEach items="${postulante.postulaciones}" var="convocatoria">

                                           <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
320 321 322 323
                                               

                                               <div class="ms-2 me-auto">
                                                <div class="fw-bold">${convocatoria.getCargo().getNombre()}</div>
324
                                                Inició en: <fmt:formatDate value="${convocatoria.getFechaInicio()}" pattern="dd/MM/yyyy" />
325 326
                                                <c:if test="${convocatoria.getFechaFin() != null}">
                                                    <br>
327
                                                    Finalizó el: <fmt:formatDate value="${convocatoria.getFechaFin()}" pattern="dd/MM/yyyy" />
328 329
                                                </c:if>
                                              </div>
330 331 332 333 334 335 336 337 338
                                           </li>
                                       </c:forEach>

                                   </ul>

                               </div>
                           </div>
                       </div>
                       <div class="col-md-6">
339 340
                           <div class="card">
                               <div class="card-body">
341
                                   <h6 class="text-start fw-bold">Referencias personales</h6>
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
                                   <ul class="list-group list-group-flush">
                                       <c:forEach items="${postulante.referencias}" var="referencia">

                                       <li class="list-group-item d-flex justify-content-between align-items-center flex-wrap">
                                           <h6 class="mb-0">${referencia.nombre}, ${referencia.relacion}, ${referencia.telefono}</h6>
                                           <span class="text-secondary"></span>
                                       </li>
                                       </c:forEach>
                               </div>
                           </div>
                       </div>
                   </div>
               </div>



           </div>
           <!-- Modal -->
           <div class="modal fade" id="estadoModalLong" tabindex="-1" role="dialog" aria-labelledby="estadorrhhModal" aria-hidden="true">
               <div class="modal-dialog" role="document">
                   <div class="modal-content">
                       <form:form class="needs-validation" method="post" modelAttribute="postulante">
                           <div class="modal-header">
                               <h5 class="modal-title" id="estadorrhhModal">Estado</h5>
                               <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                                   <span aria-hidden="true">&times;</span>
                               </button>
                           </div>
                           <div class="modal-body">
                               <form:label path="estadoPostulante" class="form-label">Estado</form:label>
                               <div class="inputs">
                                   <form:select class="form-select" path="estadoPostulante" aria-label="Default select example">
                                       <c:forEach items="${estadoP}" var="estadoPostulante">
                                           <c:choose>
                                               <c:when test="${estadoPostulante.getEstado()=='Nuevo' }">
                                               </c:when>
                                               <c:otherwise>
                                                   <form:option value="${estadoPostulante}">${estadoPostulante.getEstado()}</form:option>
                                               </c:otherwise>
                                           </c:choose>
                                       </c:forEach>
                                   </form:select>
                               </div>
                               <div class="inputs">
386
                                   <form:label path="comentarioRRHH" class="form-label">ObservaciónRRHH</form:label>
387 388 389 390 391 392 393 394 395 396 397 398 399 400
                                   <form:textarea  class="form-control" path="comentarioRRHH" id="comentarioRRHH"></form:textarea>
                               </div><br>

                           </div>
                           <div class="modal-footer">
                               <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
                               <button type="submit" class="btn btn-primary" data-bs-dismiss="modal">Agregar</button>
                           </div>
                       </form:form>
                   </div>
               </div>
           </div>

       </div>
401 402 403 404 405 406 407 408
       
       
       
       
       
    </layout:put>
    <layout:put block="scripts" type="APPEND">
  
409
      <script src="/js/valEdad.js"></script>
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
        <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>
  
444 445
    </layout:put>
</layout:extends>
446