Commit 351b8789 authored by Leonardo Piccioni de Almeida's avatar Leonardo Piccioni de Almeida
Browse files

Fix regressions in collapsible table

parent 19662740
......@@ -19,7 +19,7 @@
var ctrl = this;
ctrl.minimized = true;
ctrl.cities_report = undefined;
ctrl.cities_report = [];
ctrl.$onInit = function() {
};
......@@ -27,7 +27,7 @@
ctrl.toggleDetails = toggleDetails;
function toggleDetails() {
if (ctrl.cities_report === undefined) {
if (ctrl.cities_report.length === 0) {
NteMunicipiosReport.get({ nte: ctrl.nte.id }, (data) => {
ctrl.cities_report = data;
});
......
......@@ -26,23 +26,19 @@
</select>
</div>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Município por NTE</th>
<th>Participantes ativos</th>
<th>Participantes não ativos</th>
<th>Usuários não participantes</th>
<th>Total geral</th>
<th></th>
</tr>
</thead>
<tbody class="summary">
<city-participation-report nte="nte" ng-repeat="nte in $ctrl.ntes"></city-participation-report>
</tbody>
</table>
<div class="table" role="table">
<div class="table-header table-row" role="row">
<div role="columnheader">Município por NTE</div>
<div role="columnheader">Participantes ativos</div>
<div role="columnheader">Participantes não ativos</div>
<div role="columnheader">Usuários não participantes</div>
<div role="columnheader">Total geral</div>
<div></div>
</div>
<city-participation-report nte="nte" ng-repeat="nte in $ctrl.ntes"></city-participation-report>
</div>
</div>
</main>
</maindiv
</section>
{% endverbatim %}
{% verbatim %}
<div>
<tr>
<td><b>{{ $ctrl.nte.name }}</b></td>
<td>{{ $ctrl.nte.activity_summary.actives }}</td>
<td>{{ $ctrl.nte.activity_summary.not_actives }}</td>
<td>{{ $ctrl.nte.activity_summary.not_involved }}</td>
<td>{{ $ctrl.nte.activity_summary.total }}</td>
<td>
<button class="btn btn-primary collapse-button" ng-click="$ctrl.toggleDetails()">
{{ $ctrl.minimized ? 'Exibir' : 'Ocultar' }} municípios<i ng-class="['fa', $ctrl.minimized ? 'fa-chevron-down' : 'fa-chevron-up']" aria-hidden="true"></i>
</button>
</td>
</tr>
<div class="summary table-row" role="row">
<div role="cell"><b>{{ $ctrl.nte.name }}</b></div>
<div role="cell">{{ $ctrl.nte.activity_summary.actives }}</div>
<div role="cell">{{ $ctrl.nte.activity_summary.not_actives }}</div>
<div role="cell">{{ $ctrl.nte.activity_summary.not_involved }}</div>
<div role="cell">{{ $ctrl.nte.activity_summary.total }}</div>
<div role="cell">
<button class="btn btn-primary collapse-button" ng-click="$ctrl.toggleDetails()">
{{ $ctrl.minimized ? 'Exibir' : 'Ocultar' }} municípios<i ng-class="['fa', $ctrl.minimized ? 'fa-chevron-down' : 'fa-chevron-up']" aria-hidden="true"></i>
</button>
</div>
</div>
<div class="details" ng-if="!$ctrl.minimized && $ctrl.cities_report">
<div ng-repeat="(city, activity) in $ctrl.cities_report">
<tr>
<td><b>{{ city }}</b></td>
<td>{{ activity.actives }}</td>
<td>{{ activity.not_actives }}</td>
<td>{{ activity.not_involved }}</td>
<td>{{ activity.actives + activity.not_actives + activity.not_involved }}</td>
<td></td>
</tr>
<div class="details" ng-if="!$ctrl.minimized">
<div class="detail table-row" role="row" ng-repeat="(city, activity) in $ctrl.cities_report">
<div role="cell">{{ city }}</div>
<div role="cell">{{ activity.actives }}</div>
<div role="cell">{{ activity.not_actives }}</div>
<div role="cell">{{ activity.not_involved }}</div>
<div role="cell">{{ activity.actives + activity.not_actives + activity.not_involved }}</div>
<div></div>
</div>
</div>
......
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