convocatorias.jsp 5.43 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
                <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">
        
43
                            <input class="form-check-input" type="radio" id="cualquiera" name="estado" checked value="">
44 45
                            <label class="form-check-label" for="cualquiera">Cualquiera</label><br>
                        </div>
46 47 48 49 50
                        <c:forEach var="estado" items="${estados}">

                            <div class="form-check form-check-inline">
                                
                                <input class="form-check-input" type="radio" id="${estado}" name="estado" value="${estado}">
51
                                <label class="form-check-label" for="${estado}">${estado}</label><br>
52 53 54
                            </div>
                        </c:forEach>
                        
55 56 57 58 59 60 61 62
                    </div>
                    <div class="col-auto">
                        
                        <input type="submit" class="btn btn-primary btn-sm" value="Buscar">
                    </div>
                    
                    
                </div>
63 64
            </form>
        </div>
65
        
66
        <c:if test="${SUCCESS_MESSAGE != null}">
67
            <div id="status_message" style="color: brown;" >${SUCCESS_MESSAGE}</div>
68
        </c:if>
69 70 71 72 73
        <div class="card text-dark bg-light mt-3">
        
            <div class="card-body">
              <div class="table-responsive">
                <table class="table">
74 75 76 77
                <thead>
                  <tr>
                    <th scope="col">#</th>
                    <th scope="col">Cargo</th>
78 79 80
                    <th scope="col">Estado</th>
                    <th scope="col">Fecha Abierta</th>
                    <th scope="col">Fecha Cerrada</th>
81 82 83 84 85 86 87 88
                  </tr>
                </thead>
                <tbody>
                  
                    <c:forEach items="${convocatorias}" var="convocatoria" varStatus="sta">
                        <tr>
                            <th scope="row">${sta.index+1}</th>
                            <td>${convocatoria.getCargo().getNombre()}</td>
89
                            <td>${convocatoria.getEstado().getDescripcion()}</td>
90 91
                            <td><fmt:formatDate value="${convocatoria.getFechaInicio()}" pattern="dd-MM-yyyy" /></td>
                            <td><fmt:formatDate value="${convocatoria.getFechaFin()}" pattern="dd-MM-yyyy" /></td>
92
                            <td><a href="/postulantes?convId=${convocatoria.id}">Ver postulantes</a></td>
93 94
                            <td>
                                <c:if test="${convocatoria.getEstado() != 'cerrado'}">
95
                                    <a class="btn btn-secondary" href="/convocatorias/cerrar/${convocatoria.id}">Cerrar convocatoria</a>
96 97
                                </c:if>
                            </td>
98 99 100 101 102 103
                        </tr>
                    </c:forEach>
                    
                  
                 
                </tbody>
104 105 106
                </table>
             </div>
            </div>
107 108 109 110 111 112 113 114 115 116 117
            <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>
118
        </div>
119
         
120 121
    </layout:put>
    <layout:put block="scripts" type="APPEND">
122
        
123 124
    </layout:put>
</layout:extends>