Skip to content

Commit

Permalink
se añade orden asc y desc para ramas en tecnico asociado (#74)
Browse files Browse the repository at this point in the history
* se añade orden asc y desc para ramas en tecnico asociado

* se añade tb ordenacion as-desc a id
  • Loading branch information
AmaiaMCastanos authored Mar 2, 2022
1 parent 8157c2f commit a36020c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public class AsociadoStorageImpl implements AsociadoStorage {
private final DSLContext context;

private final static Field<String> RAMA =
when(ASOCIADO.RAMA_COLONIA.isTrue(), "rama.colonia")
.when(ASOCIADO.RAMA_MANADA.isTrue(), "rama.manada")
.when(ASOCIADO.RAMA_EXPLORADORES.isTrue(), "rama.exploradores")
.when(ASOCIADO.RAMA_EXPEDICION.isTrue(), "rama.expedicion")
.when(ASOCIADO.RAMA_RUTA.isTrue(), "rama.ruta")
when(ASOCIADO.RAMA_COLONIA.isTrue(), "colonia")
.when(ASOCIADO.RAMA_MANADA.isTrue(), "manada")
.when(ASOCIADO.RAMA_EXPLORADORES.isTrue(), "exploradores")
.when(ASOCIADO.RAMA_EXPEDICION.isTrue(), "expedicion")
.when(ASOCIADO.RAMA_RUTA.isTrue(), "ruta")
.otherwise((String)null)
.as("rama");

Expand Down Expand Up @@ -162,6 +162,18 @@ public int contador(Asociacion asociacion, String grupoId, TipoAsociado tipo, Li
else
query.orderBy(ASOCIADO.GRUPO_ID.desc());
break;
case "id":
if(ordenAsc)
query.orderBy(ASOCIADO.ID.asc());
else
query.orderBy(ASOCIADO.ID.desc());
break;
case "rama":
if(ordenAsc)
query.orderBy(RAMA.asc());
else
query.orderBy(RAMA.desc());
break;
}

return query;
Expand Down
4 changes: 3 additions & 1 deletion frontend/app/scripts/controllers/asociados_tecnico.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ angular.module('cuduApp')
{ key: 'grupo', value: 'grupoAsc'},
{ key: 'nombre', value: 'nombreAsc'},
{ key: 'apellidos', value: 'apellidosAsc'},
{ key: 'tipo', value: 'tipoAsc'}
{ key: 'tipo', value: 'tipoAsc'},
{ key: 'rama', value: 'ramaAsc'},
{ key: 'id', value: 'idAsc'}
];

$scope.ordenar = function(columna) {
Expand Down
10 changes: 7 additions & 3 deletions frontend/app/views/tecnico_fev.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,25 @@ <h4 style="display: inline-block">Búsqueda Avanzada</h4>
Grupo
<span class="caret"></span>
</th>
<th width="5%">Id</th>
<th id="id" width="10%" ng-click="ordenar('id')" ng-class="{'dropup': idAsc}">
Id
<span class="caret"></span>
</th>
<th id="nombre" width="10%" ng-click="ordenar('nombre')" ng-class="{'dropup': nombreAsc}">
Nombre
<span class="caret"></span>
</th>
<th id="apellidos" width="10%" ng-click="ordenar('apellidos')" ng-class="{'dropup': apellidosAsc}">
<th id="apellidos" width="15%" ng-click="ordenar('apellidos')" ng-class="{'dropup': apellidosAsc}">
Apellidos
<span class="caret"></span>
</th>
<th id="tipo" width="10%" ng-click="ordenar('tipo')" ng-class="{'dropup': tipoAsc}">
Tipo
<span class="caret"></span>
</th>
<th width="10%">
<th id="tipo" width="10%" ng-click="ordenar('rama')" ng-class="{'dropup': ramaAsc}">
Rama
<span class="caret"></span>
</th>
<th width="10%">Email</th>
<th width="5%">Teléfono</th>
Expand Down

0 comments on commit a36020c

Please sign in to comment.