convocatorias.jsp 5.6 KB
Newer Older
1 2 3
<%@ 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" %>
4
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
5 6
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

7
<layout:extends name="layouts/base.jsp">
8 9 10 11 12 13 14
    <layout:put block="cssDeclaracion" type="APPEND">
        <style>
            label {
                width: auto;
            }
        </style>
    </layout:put>
15
    <layout:put block="contents" type="REPLACE">
16 17 18
        <h2>Lista de convocatorias</h2>
        <div>
            <form>
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
                <div class="row row-cols-2 gy-2">

                    <div class="col-auto">
                        <div class="row">
                            <div class="col-auto">

                                <label class="form-label" for="cargos">Cargos:</label>
                            </div>
                            <div class="col">

                                <select class="form-select form-select-sm" name="cargoId" id="cargos">
                                    <option value="">Todos los cargos</option>
                                    <c:forEach items="${cargos}" var="cargo">
                                        <option value="${cargo.id}" ${param.cargoId == cargo.id ? "selected" : ""} >${cargo.nombre}</option>
                                    </c:forEach>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-auto">
                        
                        <label for="form-check-label">Estado: </label>
                        <div class="form-check form-check-inline">
        
                            <input class="form-check-input" type="radio" id="cualquiera" name="isOpen" checked value="">
                            <label class="form-check-label" for="cualquiera">Cualquiera</label><br>
                        </div>
                        <div class="form-check form-check-inline">
                            
                            <input class="form-check-input" type="radio" id="abierto" name="isOpen" value="1">
                            <label class="form-check-label" for="abierto">Abierto</label><br>
                        </div>
                        <div class="form-check form-check-inline">
                            
                            <input class="form-check-input" type="radio" id="cerrado" name="isOpen" value="0">
                            <label class="form-check-label" for="cerrado">Cerrado</label><br>
                        </div>
                    </div>
                    <div class="col-auto">
                        
                        <input type="submit" class="btn btn-primary btn-sm" value="Buscar">
                    </div>
                    
                    
                </div>
64 65
            </form>
        </div>
66
        
67
        <c:if test="${SUCCESS_MESSAGE != null}">
68
            <div id="status_message" style="color: brown;" >${SUCCESS_MESSAGE}</div>
69
        </c:if>
70 71 72 73 74
        <div class="card text-dark bg-light mt-3">
        
            <div class="card-body">
              <div class="table-responsive">
                <table class="table">
75 76 77 78
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Cargo</th>
79 80 81
                    <th scope="col">Estado</th>
                    <th scope="col">Fecha Abierta</th>
                    <th scope="col">Fecha Cerrada</th>
82 83 84 85 86 87 88 89
                  </tr>
                </thead>
                <tbody>
                  
                    <c:forEach items="${convocatorias}" var="convocatoria" varStatus="sta">
                        <tr>
                            <th scope="row">${sta.index+1}</th>
                            <td>${convocatoria.getCargo().getNombre()}</td>
90
                            <td>${convocatoria.getEstado().getDescripcion()}</td>
91 92
                            <td><fmt:formatDate value="${convocatoria.getFechaInicio()}" pattern="dd-MM-yyyy" /></td>
                            <td><fmt:formatDate value="${convocatoria.getFechaFin()}" pattern="dd-MM-yyyy" /></td>
93
                            <td><a href="/postulantes?convId=${convocatoria.id}">Ver postulantes</a></td>
94
                            <td><a class="btn btn-secondary" href="/convocatoria/${convocatoria.id}">Cerrar convocatoria</a></td>
95 96 97 98 99 100
                        </tr>
                    </c:forEach>
                    
                  
                 
                </tbody>
101 102 103
                </table>
             </div>
            </div>
104 105 106 107 108 109 110 111 112 113 114
            <div class="card-footer">
                <div>
                  <nav aria-label="Page navigation example">
                    <ul class="pagination">
                      <c:forEach begin="1" end="${pages}" var="nro">
                        <li class="page-item ${(param.nroPagina == null and nro == 1)  or param.nroPagina == nro-1 ? 'active' : ''}"><a class="page-link" href="javascript:buscarPagina(${nro})">${nro}</a></li>
                      </c:forEach>
                    </ul>
                  </nav>
                </div>
              </div>
115
        </div>
116
         
117 118
    </layout:put>
    <layout:put block="scripts" type="APPEND">
119 120 121 122 123 124
        <script language="JavaScript">
                let mostrar=document.querySelector(convocatoria.getFechaFin())
                if(mostrar!=null){
                    
                }
            </script>
125 126
    </layout:put>
</layout:extends>