Commit b3aa5626 by Joel Florentin

fix listado postulante. orden fijo

parent 01dc9393
...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -83,7 +84,7 @@ public class PostulanteController { ...@@ -83,7 +84,7 @@ public class PostulanteController {
@RequestParam(defaultValue = "0")Integer nroPagina @RequestParam(defaultValue = "0")Integer nroPagina
) { ) {
final Integer CANTIDAD_POR_PAGINA = 5; final Integer CANTIDAD_POR_PAGINA = 5;
Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA); Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA,Sort.by("id"));
model.addAttribute("tecnologias", tecRepo.findAll()); model.addAttribute("tecnologias", tecRepo.findAll());
model.addAttribute("disponibilidades", Disponibilidad.values()); model.addAttribute("disponibilidades", Disponibilidad.values());
model.addAttribute("institucionesEducativas", institucionRepository.findAll()); model.addAttribute("institucionesEducativas", institucionRepository.findAll());
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<nav aria-label="Page navigation example"> <nav aria-label="Page navigation example">
<ul class="pagination"> <ul class="pagination">
<c:forEach begin="1" end="${pages}" var="nro"> <c:forEach begin="1" end="${pages}" var="nro">
<li class="page-item"><a class="page-link" href="javascript:buscarPagina(${nro})">${nro}</a></li> <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> </c:forEach>
</ul> </ul>
</nav> </nav>
......
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