Browse Source

Fix #3130 - Colocando checkbox que filtra parlamentares ativos

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

43
sapl/templates/parlamentares/parlamentares_list.html

@ -28,7 +28,6 @@
<input v-model="nome_pesquisa" type="text" class="form-control" aria-label="Pesquisa" aria-describedby="inputGroup-sizing-sm">
</div>
</div>
<!--Lista parlamentares-->
<div v-else>
<fieldset class="form-group">
@ -42,10 +41,14 @@
</form>
</fieldset>
<br/>
<div class="float-right">
<input class="form-check-input" type="checkbox" id="filter_ativo" v-model="filter_ativo">
<label class="form-check-label" for="filter_ativo">Mostrar apenas ativos</label>
</div>
</div>
<div class="container-table lista-parlamentares">
<div class="result-count">Total de Parlamentares: <strong>[[parlamentares.length]]</strong></div>
<div class="container-table lista-parlamentares">
<div class="result-count">Total de Parlamentares: <strong v-if="filter_ativo">[[parlamentares.filter((v) => v.ativo).length]]</strong><strong v-else>[[parlamentares.length]]</strong></div>
<table class="table table-striped table-hover table-link-ordering">
<thead>
<tr>
@ -57,22 +60,22 @@
</thead>
<tbody>
<tr v-for="parlamentar in parlamentares">
<th>
<img class="img-fluid img-thumbnail" style="width: 128px; height: 128px;" v-bind:src="parlamentar.fotografia_cropped" @error="(() => parlamentar.fotografia = '')"/>
</th>
<th>
<a v-bind:href="'/parlamentar/'+parlamentar.id">[[ parlamentar.nome_parlamentar]]</a>
</th>
<th>
[[ parlamentar.partido ]]
</th>
<th>
<p v-if="parlamentar.ativo">Sim</p>
<p v-else>Não</p>
</th>
<th v-if="!is_pesquisa">
<p>[[ parlamentar.titular]]</p>
</th>
<th v-if="(filter_ativo && parlamentar.ativo) || !filter_ativo">
<img class="img-fluid img-thumbnail" style="width: 128px; height: 128px;" v-bind:src="parlamentar.fotografia_cropped" @error="(() => parlamentar.fotografia = '')"/>
</th>
<th v-if="(filter_ativo && parlamentar.ativo) || !filter_ativo">
<a v-bind:href="'/parlamentar/'+parlamentar.id">[[ parlamentar.nome_parlamentar]]</a>
</th>
<th v-if="(filter_ativo && parlamentar.ativo) || !filter_ativo">
[[ parlamentar.partido ]]
</th>
<th v-if="(filter_ativo && parlamentar.ativo) || !filter_ativo">
<p v-if="parlamentar.ativo">Sim</p>
<p v-else>Não</p>
</th>
<th v-if="(filter_ativo && parlamentar.ativo) || !filter_ativo" v-if="!is_pesquisa">
<p>[[ parlamentar.titular]]</p>
</th>
</tr>
</tbody>
</table>

Loading…
Cancel
Save