Browse Source

Transferindo logica para do checkbox JS

pull/3131/head
ulysses 6 years ago
parent
commit
b0570181b7
  1. 15
      sapl/templates/parlamentares/parlamentares_list.html

15
sapl/templates/parlamentares/parlamentares_list.html

@ -42,20 +42,15 @@
</fieldset>
<br/>
<div class="float-right">
<input class="form-check-input" type="checkbox" id="filter_ativo" v-model="filter_ativo">
<input @change="checkTitularAtivo" class="form-check-input" type="checkbox" id="filter_ativo" v-model="filter_ativo">
<label class="form-check-label" for="filter_ativo">Apenas Ativos</label>
<input class="form-check-input" type="checkbox" id="filter_titular" v-model="filter_titular">
<input @change="checkTitularAtivo" class="form-check-input" type="checkbox" id="filter_titular" v-model="filter_titular">
<label class="form-check-label" for="filter_titular">Apenas Titulares</label>
</div>
</div>
<div class="container-table lista-parlamentares">
<div class="result-count">Total de Parlamentares:
<strong v-if="filter_ativo && filter_titular">[[parlamentares.filter((v) => (v.ativo && v.titular=='Sim')).length]]</strong>
<strong v-else-if="filter_ativo">[[parlamentares.filter((v) => v.ativo).length]]</strong>
<strong v-else-if="filter_titular">[[parlamentares.filter((v) => v.titular==='Sim').length]]</strong>
<strong v-else>[[parlamentares.length]]</strong>
</div>
<div class="result-count">Total de Parlamentares: <strong>[[size_parlamentares]]</strong></div>
<table class="table table-striped table-hover table-link-ordering">
<thead>
<tr>
@ -65,8 +60,8 @@
<th v-if="!is_pesquisa" >Titular?</th>
</tr>
</thead>
<tbody :key="parlamentar.id" v-for="parlamentar in parlamentares">
<tr v-if="(!filter_ativo && !filter_titular) || (parlamentar.ativo && parlamentar.titular=='Sim') || (!filter_ativo && parlamentar.titular=='Sim') || (!filter_titular && parlamentar.ativo)">
<tbody v-for="parlamentar in visible_parlamentares">
<tr>
<th>
<img class="img-fluid img-thumbnail" style="width: 128px; height: 128px;" v-bind:src="parlamentar.fotografia_cropped" @error="(() => parlamentar.fotografia = '')"/>
</th>

Loading…
Cancel
Save